Our oldest did this too at that age. We just kept repeating, repeating, repeating that it is not ok to hit/kick/etc., it hurts mommy/daddy. I often would then leave the area, either go to another part of the room or another room altogether and say, "I don't like being hit so I am going in the kitchen. I'll resume playing with you/come back into the room with you when you can be gentle." It is frustrating to have to repeat that over and over again. It really seemed as if it wasn't working. Our son was and is very, very verbal so we were confused as to why he wasn't using words to express himself, instead of hitting. Now he expresses frustration in a much more verbal way so we are dealing with yelling/screaming/bad or undesirable words but I'll take that any day over the hitting.
Oh, keep his nails as short as possible all the time. Ds was a scratcher too. That more than anything made me see red! Something about the deliberateness of it was maddening. But he doesn't do it any more thank goodness. And it is so hard, too, when he was hitting his younger sister. The momma bear in me could not stand it when he would do that. I tried to plan our days so that they had separate things they could be doing at home each day to lessen the fights. We still do this as now they argue.
Best of luck. It will pass.