It is natural for a dog to sniff another dog when they meet but because humans communicate differently this behavior from a dog can make people uncomfortable when it is directed at them. Teaching your puppy to meet people in a more socially acceptable manner is just like any other training. You must be consistent and clear about the behavior you expect from your puppy, and redirect his nose to a more appropriate target. This training will be easier if your puppy is already familiar with a few commands such as "sit" or "down."
When you are out walking your puppy he should always have his collar and leash on. If you meet someone and your puppy greets them by sniffing at them inappropriately, give him the command "no!" and gently tug at his leash. Next, give your puppy the "sit" command. If he responds by stopping the unwanted sniffing and sitting down he should be rewarded with praise and a treat. The praise and treat lets your puppy know that his behavior is what you wanted and it helps him to understand what is expected from him. If you are not consistent the training will not go well because your puppy will be confused about what behavior is acceptable.
If your puppy sniffs at you in this way, it's important that you don't back away as this gives your puppy the message that you are submissive and he is in control, and your puppy needs to know that you are the leader of the pack. Instead, give the command "no!" and move forward into your puppy so that he backs away from you. Distract your puppy by giving him an appropriate toy that will take his attention away from sniffing, and reward him when he behaves as you wish.
Remember, your puppy doesn't know that people find his sniffing behavior inappropriate. He is just being friendly and doing what comes naturally to him. Be patient and consistent and eventually your puppy will understand.