A dog learns dexterity when it learns to use its paws, this is easier for some dogs than for others, and is the fore runner to teaching him to shake hands.
Shaking hands should be approached as a game, because in the pack raising a paw is a sign of subservience.
In addition, teaching this will aid in establishing your pack-leader status. Kneeling down on the floor position the dog on your left side, give the “sit” command.
Hold his collar in your left hand and show the treat or toy in your right hand. Move the right hand to the floor in front of his paw, holding the collar to prevent him from lying down.
Move your right hand towards his paw and as he lifts his paw, move your fisted hand under it. Holding the treat inside your fist, gently lift his paw off the floor, remain holding the collar.
Lift his paw up as you give the command “paw”, and then give him the reward. Continue with this lesson until he learns to give you his “paw” on command.
Once he learns this effectively, you can move on to teaching him to use his paw for other things. Let him see you hide a treat behind a small piece of plywood, give the command “paw” and when he touches the plywood with his paw, reward him with the treat.
Continue with this lesson until he learns to touch whatever the treat is behind, this training is the basis for many touch games that he can learn later. You can later teach him to open doors with this game.
One trick that I have taught my dog is “other hand”, when I give her the command to “shake hands” she always lifts her right paw, occasionally I will give the command “other hand” at which point she places her right paw back on the floor and gives me her left paw.
There are many touch games out there to occupy a dog, one is a box that when the dog touches the front it throws a toy out for him to catch. This is a wonderful way to occupy him and relieve him of some of the boredom of being alone each day.