The first step in alleviating the barking is to make sure your dog is properly exercised and entertained. Many people assume that because a dog is in a backyard, it means he will exercise himself or find productive things to do with his time. This isn’t the case.
Even dogs with large back yards need to walked or run at least 60 minutes everyday. Additionally, make sure to provide your pup with proper and engaging toys such as food cubes and bones to chew. If your dog is tired and has toys to engage him, he will be less likely to bark when he hears your neighbor.
Second, make sure you aren’t reinforcing your dogs barking. Often, when dogs start barking, their owners start yelling from the house for them to be quiet. Guess what the dog thinks? The owners barking with him AND he is getting more attention then he was when he was quiet. So, to the dog, barking must be a really great thing! Instead, make sure to periodically go outside and praise your dog when he is being quiet. Additionally, spend time in the yard when he may hear the people and noises that he barks at. As soon as you hear the noise and BEFORE he starts barking, praise him and give him a yummy treat. He will soon learn that being quiet is the way to get treats and attention.
Third, since barking when he hears people near and/or passing your property is normal behavior for a dog, it is important that you to teach your dog how to stop barking on command. Go in the backyard with your dog, when he hears a sound and starts barking, let him bark a few times and then say Quiet in a firm but quiet tone. If he stops barking, even for a second, calmly praise him and even give him a treat as you say Good Quiet. If he keeps barking, tell him No, Quiet and then make a sound or movement to make him focus on you. When he looks at you and he stops barking, praise. Then do it again. If you find that the noises that make your dog bark occur to inconsistently then start practicing the Quiet command with a sound you can control such as knock at the front door or a doorbell sound. As your dog starts to understand the Quiet command then you can start to use it when your dog barks in real life situations.
Finally, the hardest thing about stopping a dog from barking is that we tend not to notice when your dog DOESN’T bark. For example, your neighbor walks into his backyard; your dog hears him but stays quiet. Chances are that you didn’t even hear your neighbor or notice your dog’s good decision! So during this process, pay attention to those moments of silence and let your dog know how good he really is!