One Of The Biggest Hurdles In Dog Training :
"Woof! Woof! Woof!" ... "Whiiiine ... Woof!"
Like thousands of other dog owners, when I would hear this, I'd get up to let the dog back in after a quick romp outside, or feed him, or let him out of the crate at night (as a puppy), or reach over to pet him if I thought he was scared.
In a short time, I wound up with a dog who would whine, bark, or howl for attention, whenever he wanted it. By petting him, talking to him, or opening the door, I taught him that he would be rewarded with something he wanted when he made a lot of noise.
What else are the commonly rewarded behaviours? How about fear? When your dog starts to whimper, shake and whine during a fearful episode, are you the type to try and offer comfort by petting and cooing? That is the reward, and your giving something that your dog seeks for a behaviour that should be eliminated.
Attention of any kind when a dog misbehaves is a signal to the dog: "hey, this works. It's not quite I want, but it's still attention." Even negative attention is better than none at all.
Great! I'm guilty. How do I put a stop to it?
Ignoring It : Without a doubt, if it's barking, whining, or grunting, ignoring it is the best option. This is harder if the barking occurs outside and you have neighbors to worry about. If this is the case, I suggest contacting your neighbors, let them know your involved in a training process to put an end to the excessive noise, and ask them to bear with it for a few days. Most should be understanding.
Now the fun part. Resist the urge to open the door, yell, or pet when he's barking! Just wait a while, until he stops and is quiet for a minute or two, then open the door before he starts up again (or do whatever it is you usually do). Lavish praise on him as long as he's quiet, for being quiet, but as soon as he opens his mouth to emit those doggy noises, walk away and ignore him, no matter what he does to get your attention.
There's no such thing as an overnight success, and anytime you cave in, you'll just have to go longer before he understands that quiet is good, and barking for attention is no reward at all. This could take a while.
Something else to consider. If your dog is barking for attention, maybe it is time to reevaluate just how much attention he gets during the day. Perhaps just by spending more time with him, giving him more exersize, you might find that your problem is solved without difficulty after all.