Summarize:

You will need to reward your dog when he shakes. Bite-sized treats are good for training because you can give your dog more of them without feeding them too many extra calories. Also consider what your dog likes and what will motivate them: does your dog like soft treats or hard treats? Is there a certain flavor that your dog seems to respond to more? Figure out which treat works best for your particular dog and have them on-hand for training.  Try making your own treats.  These could be small pieces of cooked meat or even some fruits and vegetables. Don't overfeed your dog.  Keep treat sizes as small as you can. Do not feed your dog the following food items, as they can cause poisoning or illness: avocado, chocolate, bread dough, grapes, raisins, hops, ethanol, moldy foods, macadamia nuts, xylitol, onions, garlic. The only way a dog can shake hands is if they are sitting.  If your dog doesn't know how the command for sit, you will need to teach them to sit first. Don't reward the dog with the treat here, as you are teaching him how to shake, not sit. You won't be giving the treat to your dog just yet.  For now, simply keep the treat in your left hand.  Bring the treat in front of your dogs nose, showing it to him.  Once you have his attention, close your fist around the treat.  Don't let the dog grab the treat from you yet. Hold the treat between your thumb and your palm. " This is the command you will use to ask your dog to shake (you can also say something else like "Shake" if you prefer). Say this as you hold the fist with the treat in front of your dog. Once your dog realizes you have a treat in your closed hand, they will try to get it from you. When they make a move toward the behavior you want — such as lifting a paw to try and get the treat from your fist — say "Yes!" with a lot of enthusiasm and excitement and give them the treat.  When your dog makes a move toward the behavior you want, immediately reward them with the treat. Ignore any other attempts your dog may make, such as sniffing or mouthing your hand.  Be patient. Practice this way a few times until the dog is reliably lifting their paw when you say "Paw." Once your dog is lifting their paw on command, you will want to take it to the next step. You should begin reward the dog only as they do something closer to your goal of shaking. For instance, if your dog lifts their paw higher than before, that gets a "Yes!" and a treat, but not before then. Continue in this way until the dog is offering their paw. Use this additional step only if your dog doesn't seem to paw at the treat in your hand.  By picking up your dogs paw, and praising them during and after, you start to show your dog that pawing at your hand is rewarded.  Hold the paw for a few seconds before rewarding. Be gentle and move slowly.
Pick out some treats for your dog. Have your dog sit down. Present the treat to your dog. Give the command "Paw. Say "Yes" when your dog begins to fidget. Reward the dog for shaking. Take your dog's paw in your hand.