This is a phase- they all do it! And it is just like what you said- he wants things and can't really communicate all of it and it turns into whining. Man, whining can be really grating. And its doubly stressful because you go through the internal debate of "Do I give it? How much should I expect? Can he learn "manners"? It's just a little thing... no! It's the start of a behavior pattern I need to nip in the bud! No! He's just little! AAAAHHHHH!"
They whine because they want and can't use words. They also have no concept of time, that you can't pay attention to them every moment, that there are things they can't have or do, that there is danger out there, etc. So, they whine and get frustrated and it is part of development- learning these limits.
When we were going through this, I staked out things that were absolutes- no playing withthings that were dangerous, no hitting, etc. Then, I tried to give him what he wanted as long as it was reasonable. Because they don't understand time, what I asked from him was to stop whining and say "please"- just the word "please" (the rest I could figure out). To me, that was enough and he was able to do that and it seemed to be a way to convey the message that whining wasn't the way, but it wasn't expecting more than you can really ask from such a little passionate, living-in-the-moment person that a young toddler is. We still occasionally had some whining, and of course, there were temper tantrums sometimes when I didn't give him what he wanted, but that, too, is part of learning.