this is one of many different ways a baby "copes" with frustrating things... ie: even screaming is a way for them to "tune-out" over stimulation and external stimuli, when tired, because it "blinds-out" the noise that is irking them or frustrating them. It is a phase and will pass though.
For banging his head, you got a lot of good advice...
at this age, everything is an introduction... and abstract concepts is not really literally understood by them yet.. nor, being told "no." But they will learn... keep in mind, that kids also get de-sensitized by hearing "no" so much, then they just tune you out.
What I did/do with my kids is teach them "danger", "stop...", "wait..." and concepts such as "hot" and "cold."
But using that in tandem with distraction & re-direction.
ALSO, though, important to remember, is that a child this young does NOT have "impulse control" yet. FULL impulse control is not even fully developed in TEENagers... so, keep expectations in line with their age and keep it age appropriate.
Grabbing things is all about exploring, it is an "instinct' in them. They can't stop... so we just have to, over time... guide them about their world, what is "dangerous" and what is safe or unsafe. And it takes LOTS of repetition teaching them. Even if they "know" this... you will STILL have children that will touch dangerous things or do dangerous things. It is only part of their learning...
For me, I let my kids touch anything ... even mud, and I was right there, and we explored and smelled things and touched different textures.... thereby, lessening the "forbidden fruit" attitude about it... thus building up "familiarity" with objects/things... and thus, confidence about their reactions about it and their world. And, so what if they got dirty. I dressed them in clothes I didn't mind that got dirty. If they "ate" a leaf... then I just took it out of their mouth... and I know what plants are poisonous or not. So I never panicked. But, if they put a rock or small object in their mouth.... I said "Danger, stop." then took it out of their mouth and pantomimed to them what can happen... ie: choking. Beyond that, I just made sure there were no small choking hazards in the house.... because I know a baby this age cannot control themselves or self-monitor.
Give it time, but he will outgrow this reaction. Most babies do. Some even hit themselves out of frustration or pull their hair.
Instead of telling him "no"... try using other words such as: 'stop, look at Mommy..." or, "hurt... danger..." or "Uh-oh... " The goal being to use a word that will trigger a distraction and cause them to LOOK at you, instead of tuning you out. Then kneel down at his eye-level... and pick him up, and hug him. Or, give him a pillow, and have him use that... teaching him "hard" versus "soft" kinds of things.
Oh, and keep "explanations" simple... NOT too "wordy" or they will not understand and/or their attention span just won't follow you/listen after 10 words of "explanation."
Keep it all in line with their age and cognition.
All the best,
Susan