The best way to teach a dog to stop something is not to let him do it in the first place. So, if you do not want puppy to jump as an adult, do not let him do it as a baby. Plus, jumping can be dangerous. A former colleague of mine had her hip broken when a dog jumped on her and knocked her down. Some people may mistake jumping for an attack and you could be in legal hot water. Jumping muddies clothes and tears stockings. Jumping is not a good habit. Also, allowing puppies to jump can injure growing joints.
Jumping on you:
When puppy or dog starts to jump you are going to freeze and give NO attention at all. Some dogs do not care if the attention they get is positive or negative. They just want attention of any sort. So you will give no attention at all for this action. When the jump happens, turn to the side (smaller target) and do not make eye contact, touch or say anything. The dog is invisible. When all four feet are on the ground, wait a moment to see if he remains off and then CALMLY say "good." (An excited tone will rev the dog up; you want him calm so you remain calm).
If he starts to jump again, immediately freeze and turn off to the dog. If he wants attention, he has to keep all four feet on the floor. You can reinforce the desired behavior with a small treat when his feet are on the floor. Gradually increase the amount of time his feet remain off you before you "notice" him.
Dogs like physical security – and this means feeling balanced when on something. With larger dogs, just walk forward as the jump begins. Do not go backwards as this is a retreat and can encourage a jump. Just take a step forward so the dog cannot get balanced, this will force him to put his feet on the ground.
There is no kneeing, no yelling, no toe pinching, nothing punitive, just the dog will not be allowed to gain purchase on your body. Aside from that, you are ignoring him. When all four feet are on the ground, the dog gets gentle praise and calm attention. With smaller dogs or puppies, slide a leg forward; a step could end up with a smaller critter under your foot. Or with any size dog, lean towards the jump so the dog cannot balance.
Soon the dog will learn that proper manners increase the chance of a desired reaction or any reaction. The dog is learning self-discipline in order to get what is desired (attention).
Jumping on others:
Set up to begin teaching off in regard to jumping up. Have puppy/dog on lead and collar. Have a second person (family or friend approach puppy). When puppy/dog jumps, immediately give a firm "Off!" And guide puppy/dog off and to the side. Do not pull straight back, it can actually encourage a jump. Do not yank puppy off his feet. You could hurt him.
Once puppy is off, walk the puppy/dog away a few feet or more. Calmly settle and have him sit. When he is sitting, have person approach. Should a jump begin, repeat "Off" and guide away. There can be no greeting if the dog is not sitting.
All family members and friends must enforce off. If only mom or dad enforces "off," and the kids or Aunt Edna allows it, puppy/dog will confuse and think jumping is OK or just get really stressed about it. Insist people wait until puppy is sitting before they greet him. Feel free to explain you are trying to teach Puppy good manners when people say "hi." Most people will appreciate this!
And remember, the longer undesired behaviors go on, the longer it will take to stop them. So if you have allowed your pet to jump on people for the past year or two, this behavior will not be stopped overnight!