Dogs are bound to bark. It goes with the territory (no pun intended). Anything new, or suspicious, or stimulating can produce a woof-fest. It's an instinctive, "vestigial" thing (a behavior left over from when dogs were wild). When dogs live in packs, they bark to let each other know where they are; they also bark to let each other know that a stranger is approaching their territory, and to let the interloper know "this seat is taken!"
Dogs will also bark because someone is going away, which leaves the pack one dog less secure. Dogs hate being alone, and when we domesticated them, that meant they hated being without us. Anyway, it's good to try to figure out why your pup is mouthing off, because that will influence how you should address the problem. First of all, you can't cure barking until you have worked on training him in general. To change a behavior, he has to understand the basic deal: do what is asked and you get a reward. It takes a while for him to get it; he'll want to go straight to the reward and forget the obedience part. So be persistent over weeks and months!!!
There are basically two techniques: distraction and reward. Some people say there's also "correction", like electric shock or citronella bark collars. Forget it. Would you stop your infant son's crying by giving him a shock or squirting him in the face with citronella??? Come on, dogs have nerve endings too. Instead of "house of corrections" training, settle on the command you'll use to stop barking, like "no bark!" Use the command as soon as the dog starts to bark; approach him and stare him in the face as you say "no bark!" Put your hand gently but firmly around his snout and repeat the command. When he stops, reward him (food, praise, both...it all works). Distraction can be any benign event that will interest the dog. Throw a ball or otherwise play with him; give him a hug; take him someplace (like out). With Benny, who needs a barker's 12-step program, I bounce a ball and act all excited about it. Most times he forgets what he was barking about.
When you leave the house, don't pay attention to him for 15 minutes before you leave and 15 minutes after you get home. This is counter intuitive but ESSENTIAL! If you make a big deal out of coming or going his anxiety is going to skyrocket! WOOF! WOOF!