Believe it or not, most people do not want to be greeted by your dog's two front paws and a nice slobbery tongue to the face. Even if your dog can only reach the knee caps, it can be a safety issue, or sometimes people just don't like dogs.
Dogs have a whole different language than we do, which deals a lot with body language. While a nose to your butt or crotch may be terribly embarrassing to you, it's just how dogs get information. Dogs also enjoy getting in your face and possibly giving kisses too, and because your face is all the way up there, well they just have to get to it! So, how do we teach our dogs that some people just don't appreciate a full frontal greeting? We teach four on the floor!
When to Start?
Ideally, you should start managing and teaching this concept to your dog or puppy as soon as you acquire them. It is so much easier to teach this to a puppy who has not had a long history of reinforcement for this behavior. If your dog has already practiced this for years and you are just sick of it, or you recently acquired an adult who came with this sometimes annoying habit, there is still hope! Just remember that your dog has had years of reinforcement for this behavior, so it is likely that you won't fix it in a day.
Manage the Situation!
Before we can start teaching our dog or puppy to keep his four feet on the floor, we have to stop the behavior in it's tracks. The longer your dog can practice this behavior, the more reinforced the behavior will become. This is making sure your dog never has the opportunity to jump on someone.
If you are expecting house guests, either keep the dog on a leash so he cannot get to the human, or separate him in another room or crate. If you are not able to train your dog when someone comes into your house during the training period, do not allow your dog to practice this undesirable behavior, remove him from the situation to make it easier for him. It is not nice of us to expect our dogs to know better before we have had the chance to show them what we want. They are not mind readers, even though that would be wonderful!
But I want my dog to be able to interact with my house guests! We're getting there. :)
It is easier to train your dog in a 'training' situation. Do not pull out some treats and a clicker when you have a novel guest coming over, as it will likely be too much stimulation for your dog and he will likely jump.
First, we have to think of what we want our dog to do, instead of just saying, "I don't want my dog to jump up." Okay, so what can our dogs do instead? Sit? Stand? Down? Most people want our dogs to sit when we have house guests, but sometimes that is just so hard to do with a wiggling tail in the way. So let us just say we want our dog's four feet on the floor as they go up to our guests.
I am going to assume that if your dog is jumping on house guests, they also jump on you. So since they see you every day, we will start with using your own self as the target. Grab a clicker, some yummy treats, and tether your dog to a rather sturdy object. (Heavy couch leg, tree, door, etc.)
With a clicker and treats in hand, start out of reach of your dog's legs. As you approach your dog, click immediately for the dog's four feet on the floor before he has the chance to jump up. Throw the treat on the ground so the head goes down, making it impossible for your dog to eat the treat and jump up at the same time. As your dog is eating the treat, click again for four on the floor and throw the treat down again. Do this a few times rapid fire (click/treat, click/treat, click/treat, rather close together before your dog has time to practice the bad behavior). After four or five times, add a slight pause as your dog is eating the treat, and they will probably start lifting their head to look up at you, click this and throw the treat back down. Slowly begin lengthening the time between each click/treat, getting a feel for that moment right before your dog begins to even think of jumping up on you. After thirty or so seconds, back away and give your dog a break. Frequent breaks are important. It allows the dog a few seconds to process what just happened and for them to store away the 'lesson' they just learned.
After a few seconds, approach your dog again and click/treat before they jump again. Continue working on lengthening this process in short 30 second sections. Don't forget the breaks! Okay, so now your dog is catching on to the game. Approach your dog again and wait a second before clicking as they stand there looking up at you. Click/treat and walk away! Work on the approach quite a few times as that can be the hardest part sometimes! Now the next time you approach, bring your hand out towards your dog like you are going to pet them, and click/treat before they can jump and before you even touch them, and walk away. A hand going out to pet them can be so hard sometimes. Sometimes they just don't want to wait for that hand to get to them, so they speed the process up by meeting the hand half way. Always remember four on the floor, even if the paws aren't touching the person. Begin to work your hand closer and closer to the dog without them jumping until you can scratch them on the head or underneath their jaw (wherever they prefer).
You can either hold the leash now or keep your dog tethered to the object. I recommend tethering your dog to an object if you are new to clicker training, that way you don't have to juggle the clicker, treats, and a leash together. Your treats may have to be more novel or 'high value' for a new person, so that our dogs will be more interested in the reward than the person. For very people driven dogs, that can be hard. It's a matter of trying different treats with your dog and seeing what really gets them excited. Most of the time it will be something moist and smelly.
You will repeat the above steps with the new person. When you go to take your breaks, I would work on calling your dog's name once, and then click/treating them for turning towards you and walking away with you. If your dog is tethered, I would stand a few feet from the dog, call them, and click/treat as they walk towards you, having your guest also walk away at the same time. This builds the value of your dog's name, and helps your dog practice leaving an exciting situation, which can be hard for them.
Start doing these training sessions with as many people as you can and in as many different places. Dogs do not generalize well so it takes many repetitions with many new people and places to generalize this no jumping idea. You can now begin to utilize this training when you have random guests come over. Remember that it might be harder when you have multiple people over, so always take that into account. If you don't feel like training for that particular guest, or you fear your dog will be too overwhelmed, remove them from the situation so they cannot practice the behavior.
Being persistent is a big part of having a dog who does not jump on guests. It's something very simple to work on, but it does take commitment to yourself and your dog to never allow them the opportunity to jump on someone. Accidents do happen, but it is our job to make sure they do not happen often enough that it selectively reinforces the behavior and makes it even harder to get rid of.
"While we were training, my dog was still able to jump up on me!"
Then you were moving too close/fast for your dog. It takes some practice, but you have to work on getting that click/treat before they have the opportunity to jump. Is it while you are approaching? Click/treat before you get close to them, and toss them the treat. Work the rapid fire click/treats while you approach them, and then leave. Do this a few times until you don't have to click/treat as fast as you approach.
If the jump happened at a random time while you are training, remove yourself from the situation without acknowledging your dog (including pushing them down or saying 'No!") Give them a few seconds to regroup and go back and continue your training. Removal of reinforcement will speak volumes to your dog when they want your attention and the food you're giving out.
"This this and this happened, and my dog was accidentally out while a guest came over and he jumped all over him. How do I stop this situation?"
Make sure your guest removes his attention. Again, no pushing or talking to the dog, or saying oh, it is alright. Once the dog is not getting any reinforcement from the person, if you are confident your dog will come to you when you call his name, do so and reward your dog for listening to you. Remove your dog from the situation, but don't forget to reward your dog coming to you first! If you don't think your dog will listen to you, but is okay with you collar grabbing, remove your dog how you see fit. The most important thing here is the stopping of reinforcement from the guest, and you getting your dog away from the situation. Just remember that there is no reason for you to yell or hit your dog in this scenario, as obviously it is not their fault they were able to practice this behavior.
If you have any other questions that arise in this training scenario, feel free to comment. I may or may not try and make a video tomorrow with a dog who is new to clicker training and the idea of four on the floor.