You aren't going to like my answer, but at some point, you'll probably use it. At his age, he understands words like hurt and ouch. In as few words as possible, tell him how badly this hurts and give him a warning. At that point, when he does it again, he needs to sit for one minute in the naughty chair. Not because he pulled someones hair (he's doing that out of good intent and it gets him attention, even if its bad attention), but because he is not listening to what he is told.
To be quite honest though, I had a similiar problem with one of my children, but it was biting. One day, I just bit back, hard. To this day, that child has never bitten another person. That child is now 24.
Good luck either way, I am sure its a frustrating situation.