The "laws of war" apply only if both sides abide by them. Clearly Hamas/Gaza/Palestinians or whatever they call themselves don't do that.
Plus, Israel is dealing with a societal issue. The terrorist leaders exist because the people want them to.
As an example outside the Middle East, World War 2 happened because not enough average Joe German civilians died in WW1 because the Allies didn't bring the war to the German homeland. Want to know why Germany hasn't started WW3? Because the Allies in WW2 made sure the Germans also lost civilian lives by bringing the war to Germany. The same for Japan learning to quit starting wars. Nobody has taught that lesson to the jihadist nations.
FR has some real hardliners! I’m just a softie
There is no way they will surrender it’s not a country or a traditional sort of enemy
Law of War wouldn’t include Hamas or Hezbollah. They aren’t states just terrorists supported by Iran. They also fail on other requirements.