Two year olds are incredibly intelligent and are easily reasoned with. Make sure they are not seeing any examples of hitting because they do tend to mimic what they see. When they strike out at someone else keep repeating and reinforcing that hitting anyone is not appropriate.
You need to punish him for hitting. If he goes to hit tell him "NO! " and tell him that if he keeps on doing it you will make him sit on a time out chair. Children learn to hit often times by people they're close to.
I knew a woman who broke the habit of biting by biting the kids back. It may sound a little barbaric but it always worked. This positive punishment will result in the decrease of biting. You can try a light tap on the butt. If you don't believe in spanking try taking away something the child enjoys.