I still do that...I bang my head on walls, hum, and rock back and forth.
I'm almost 44!
He's doing it ( the head banging ) because it makes him forget the hurt he's feeling.
He's too young to tell you how he feels. He doesn't have the words for it.
I have no idea why I still do it...oh ya...it's because I have no one to tell my problems to when I get mad, sad, frustrated...until now that is. Great site!
When I get seriously angry and no one listens to what I say I'll do all of the above and sometimes pull my hair out...literally...in frustration.
As for the humming and shaking his head...that's a normal 2 year old thing...he's learning about his body and how it works.
Mine does that ...and he also flaps his arms like wings...I blame that on the Elmo chicken doll someone bought him. lol
I'm not saying this "head banging" is "normal" behaviour, and it's certainly dangerous...I could have caused myself a lot of brain damage over the years...maybe I have and don't know it yet.
You should bring him to see a pediatrician...the sooner the better.
What is he like otherwise? Is he an only child?