He does not like another child taking his mom's attention and hitting is the only way he can express it. Teach him alternative ways to deal with his feelings. Watch what is happening when he hits and attempt to interpret what he is feeling. Then teach him alternative ways to deal with it. Crumbling up paper, tearing up paper, coloring with black, beating a pillow are all ways, for example, that one can release frustration and/or anger. Punishing him only contributes to his already frustrating feelings. When he raises his hand to hit, (this requires you to be RIGHT THERE), gently grab his hand and say lovingly, "gentle hands,". Then if he can easily express himself, attempt to find out what he is frustrated about, and give him choices for other ways of releasing it. You may literally need to be beside him every minute for awhile, maybe even months, until he learns. He needs your constant attention to learn a new way. When he uses his hands in any gentle way, comment about it, so he learns what gentle hands are. Last but not least, a word of caution, if anyone is using any hitting in his presence, either against him or anyone else, he will model it, so that would need to stop. I served as a nanny for a 2 yr old when his baby brother arrived, and I worked to curb his hitting. These suggestions are what helped, but the bottom line is, he was/is jealous and did not want baby to arrive. Consistent loving, modeling, and intervening is helping, though. Also found that offering choices to the 2 yr old helped a lot in his feeling better about his "power", so then he didnt have to use his power in negative ways.
Also giving him enough positive attention at other times is also necessary.