You are trying to use the Dresden Defence which was rejected at Nuremburg. One of the differences is intent. Hamas gave no warning and deliberately chose to commit atrocities against civilians, comitted rape and took hostages. These are war crimes.
They also use their civilian population as human shields, again a war crime.
Hamas broke the ceasefire deliberately Israel has a right to defend itself.
https://martinkramer.org/2023/10/26/nazi_case_for_hamas/
The fact that individual men killed civilians face to face is looked upon as terrible and is pictured as specially gruesome because the order was clearly given to kill these people; but I cannot morally evaluate a deed any better, a deed which makes it possible, by pushing a button, to kill a much larger number of civilians, men, women, and children.
SS-Gruppenführer Otto Ohlendorf
The chief prosecutor, an American, called this particular iteration “exactly what a fanatical pseudo-intellectual SS-man might well believe.”)