If you had read it properly, it states the limitations of that. It IS limited which means Hamas has breached IHL in every way possible from the hostage taking to indiscriminate attacks on civilians.
The intention of terrorist groups IS to deliberately attack and murder civilians in order to coerce governments to do what they want.
This is not equivalent to the counter-terrorism of Sovereign Powers.
Additional Protocol I also requires that "such armed forces shall be subject to an internal disciplinary system which, inter alia, shall enforce compliance with the rules of international law applicable in armed conflict”.
So, Hamas is solely responsible for their members complying with IHL. And for their failure to do so.
As John Spencer, chair of urban warfare studies at the Modern War Institute (MWI) at West Point, codirector of MWI's Urban Warfare Project and host of the "Urban Warfare Project Podcast", stated very recently:
"Hamas knows the laws of war, it knows the public sensitivity, and it exploits those to both hamper the IDF's actions and invite international condemnation."
Finally, resistance doesn't have to take the path of using weapons which is often a counterproductive way to achieve a particular goal. Other non-violent methods are available and can often work better in the long run.
But the problem really becomes intractable when a terrorist group engages in terrorism which then forces a counter-terrorism response from Sovereign Powers.
A vicious cycle is then created which also means a peace process cannot achieve the goal of peace without a successful security management of the problem of violence. That might seem counterintuitive, but that's the practical reality.