MISTAKE #1: Your dog has his nose pressed to the window watching for cars. The first thing you need is a dog who has the ability to obey and relax. If your dog can lie down (dogs do not bark as much when lying down) and stay, you are well on the way to solving a nuisance barking problem.
MISTAKE #2: You yell every time he barks. In most cases shouting "No" is only going to make matters worse since the dog thinks you are barking too. Do not try to shout over the barking.
MISTAKE #3: Everyone in the house uses a different command. Be consistent. Pick a one-word command; e.g., "Enough" for the behavior you want to stop and everyone uses that word in the same tone of voice.
MISTAKE #4: You try to soothe or calm your dog. Do not hug your dog, talk soothingly, or otherwise play into your dog's barking. This reinforces his behavior and he will likely bark even more the next time.