Yep. They do that. He's so young. He doesn't have any other way of communicating his frustration to you. As his speech improves, you can encourage him to use his words. For now, it's important that you stay calm. If he's upset that he couldn't have a cookie, get down on the floor next to him and say, "You really wanted a cookie, didn't you? I like cookies, too. It's hard when you can't have the things you want." Just empathizing with him can help. If it doesn't help and he just keeps kicking or punching the floor, try saying, "I know you're upset. Mommy's going to go to the living room. You can come, too, as soon as you're ready."
If those tricks don't work or he can't hear you over his own crying, just step away. Definitely keep an eye on him so that he doesn't hurt himself, but just give him some space and try not to give him any attention. Eventually, he will learn that he doesn't get the desired response and stop throwing temper tantrums.
But right now, he doesn't have the language skills to tell you why he's upset. That takes time. Even when he can say more words he may not be able to even know why he's upset. That's just a developmental milestone that comes later. As hard as this is on you, this is just part of life with a 2 year old.