Prior to touching his leg give him the que, sign, verbal command, etc that you are going to use for shake hands. Keep repeating this proceedure, being careful not to do it so long that he gets bored or frustrated with it. Be patient, this should be fun for him not a high stress situation. Teaching horses tricks is NOT at all difficult it just takes times and ALOT of patience. The natural born comedians in the group will pick up on the tricks quickly, will enjoy the attention and the treats that doing tricks brings.
Safety is always a primary concern when doing tricks with animals.
Teach ONLY one trick at a time and do not start a new trick until your horse performs the current perfectly and fully understands the cue you give. Doing more than one may confuse him and then you will be back to square one.