Ok, but no one is going to really accept that this is the way it works - or should work.
Let's play through the scenario. HAMAS blatantly breaches any international law or convention ever written. It raids a music festival and commits obscene and stomach turning outrages against helpless women and children and takes hostages like some band of Medieval barbarians. It also subjects Israel to a bombardment.
It then retreats to Gaza where it has deliberately and carefully prepared fortified positions under essential civilian humanitarian structures, thus ensuring that Israel too must - arguably - breach the Geneva Convention if the IDF attacks HAMAS and destroys its capacity to commit more war crimes.
HAMAS can then argue - like
@DinkleMouse - that if Israel kills 5,000 Palestinian civilians to stop HAMAS attacking again and killing 4,999 or fewer Israeli civilians that Israel has failed "proportionality" and is the bigger war criminal.
The convention was clearly never written to be distorted in this way.
NO country is going to accept that a terror group can raid, torture, rape, murder and kidnap its citizens simply by then fortifying a hospital as its stronghold. It's just too easy an exploit to set up - again and again and again and again.