He didn't learn it. An older child who suddenly changes behavior to having tantrums may have observed it getting results for another child---but for babies, no.
I was reading something recently that talked about the different statistics of "easy" vs. "difficult" babies in different countries and ours. What we call "difficult" babies here are the ones that survive in dangerous conditions (starvation, disease, etc.), because they make a big fuss about what they need or want, while sweet, easy tempered babies will be quiet and are more easily neglected, and they die in higher numbers.
In other words, some kids are stubborn, willful, and difficult tempered--but this can be a real advantage in life. It just means that they *really* want what they want, and are persistent about it.
Whatever you do, be consistent. An INconsistent parent is a Slot Machine. A child expects that the next try will be the one that pays off, and they'll keep trying and trying, asking and asking, crying and crying, until the parent gives in, because they always do... sooner or later.
Basically, every behavior has a purpose or goal. If the behavior is bad, you want to make sure it doesn't pay off for them, and ideally you also want to gradually replace the bad behavior with a good behavior that will work for them (if what they want is acceptable, like attention). But you can't teach them the good behavior while the bad behavior is happening; it needs to be done at other times.
If your son doesn't get a payoff, ever, for his bad behavior, he'll give up. But be aware that a payoff can be mom getting upset, IF he expects that mom being upset will lead to good things for him. For example if you often hug and kisshim or give him things when you are worried, sad, exhausted, or feeling guilty. It's really hard. It might even go on for years, if your son is especially strong willed and determined, like one of mine.
Some kids think the world should adapt to THEM, instead learning to adapt to the world.
But don't be scared, yours might be a much faster learner (and adapter) than mine. = ) And like I said, it can be an advantage later in life for him to be a determined person who fights for what he wants. It's just a pain when they are little kids, crying and flopping on the floor. = )