There might be some potential legal defense in terms of proportionality of collateral damage but it's so thin here as to be absurd.
Regardless, given the number of war crimes this army has been found guilty of, this is somewhat moot. What's another war crime in the grand scheme of things.
there is 0 war crimes that IDF has been found guilty of by any legal authority.