To train your dog to act appropriately and be calm when he encounters strangers you should never punish reactive behavior, do not yell or pull back on a lead, which creates more excitement and anxiety and makes the behavior worse. You want your dog to be mentally relaxed when he encounters a stranger. Although he may be happy, and excited, or bark to let you know someone is there, there would be a confident, balanced, relaxed posture, and his behavior should be controlled and calm. The best way to create calm behavior around strangers is to socialize your dog early by exposing him to lots of different people and situations. During the training period you will want to keep your dog from being exposed to strangers except during scheduled training sessions, where you can modify your dog's behavior. Do not punish or force your dog to accept handling from a stranger during training, you will need to exercise patience and move at your dog's pace. Enlist friends who are not afraid of dogs, and who your dog is unfamiliar with, to assist you in training. Have lots of treats available to positively reinforce appropriate behavior.