I think you need to think about your son's young age and deal with the misbehaviour in a way that he can understand.
At 3 years old he is still too young to understand about other people's feelings, so he doesn't understand that if you are talking to someone you can't attend to him straight away. Nor does he understand that hitting someone can hurt them.
The first thing I would suggest is to catch him behaving well, and praise him when you see it. When he is playing nicely, or waits for you patiently, tell him Well Done for playing quietly, or well done for waiting, give him a big smile, a hug, or have a short game with him.
The key is to catch good behaviour and reward it as quickly as possible and in a way he understands.
When he hits you, try saying "No, that hurts," calmly and firmly, or even better just ignore him and walk away. Ignoring bad behaviour when you can means he is less likely to do it again for attention seeking!