I have 2 boys and now they are 15 and 10 yrs old. When my 15 yr old was 2 he used to do the same thing when he couldn't get his way. He would bang his head everywhere and anywhere. Once I went to the mall with him when he was little and he got mad about something and sat down on the floor and banged his head on the concrete floor. I was horrified because he had a huge bump on his forehead.
I can say that he probably will not do it for long. My second son was much different. He did not bang his head!
I guess he is going to realize how much it hurts and stop. I really can't remember because it's been 13 yrs but I think after the mall incident it pretty much stopped.