By playing some simple games like fetch with your dog, you can kill 2 birds with one stone. First is that the actual playing of the game will surely tire them out so much that they won’t have the energy to jump the fence. Second is that you are associating the fun of the game with the yard. If they have fond memories of the yard they will be less likely to try and get out.
If you have ever seen two dogs when they meet, they greet each other face to face, unless there is a massive size disparity. So, why are we surprised when that is how a dog wants to greet us? You come home from work and let your dog out, and they are excited to see you and excited to show you how much they have missed you. So they jump up on you to get closer and give you some love. 

Puppies in human households try to lick the weird, flat, usually bald body part we have instead of a muzzle. When a cute little puppy jumps up to lick face, many people can only say “Awwww!” Hey presto! Jumping up has been rewarded. The puppy’s natural inclination is now a learned behavior. Too bad for the dog when he’s nine months old, bigger and less cute, muddying the pinstripes and knocking Granny to the ground.
×