Help with toddler!

My son is two and will not stop hitting especially when he's angry. I tell him no and take away his toys as punishment but he does not take me seriously 😓. I've also tried time outs but he doesn't get it. He just sits there and thrashes and screams none stop. He knows hitting is wrong as he smirks at me when he does it. How do I get him to stop????