Maybe it was on another thread, but I posted a link to some training lessons that are very helpful. You have to go about training in a systematic way. Distractions are an entirely different lesson. Dogs don't generalize very well. So, if a dog can sit in a boring room of your house, that doesn't mean that "sit" means the same thing outside where there are distractions. You have to understand how dogs think and learn. If you have too high expectations, you end up getting more frustrated and possibly taking it out on the poor dog who doesn't know. When you say he follows basic commands great but only when HE wants to do them.....well, naturally. Dogs always do things to please themselves. You have to motivate your dog so that he DOES want to do them. And you have to be able to show him in a way he understands. He has to have had a sufficient volume of reinforcement in order to repeat behaviors reliably. He doesn't think like we do and isn't stubborn or diobeying because he's naughty or immoral. He is a dog and dogs do what works for them. They're innocently selfish. That's just the way they are.
So learn a little about how dogs nature is, how they process information, how they learn and how to train. These things have been studied, observed, researched by leading experts in the field of behaviorism and they're the ones to learn from. Don't get sucked into this pack theory, show 'em who's boss, yank and jerk and scold mumbo jumbo. Learn how dogs learn and learn how to show your dog.... and you'll have a great dog.
Well, here's the link again:
http://www.clickersolutions.com/articles/index.htm