You need to study the laws of war. They clearly state that if your enemy hides and fires at you from inside and next to "protected sites" such as mosques, hospitals, schools, etc. and/or behind civilians, that removes the protection those places and people enjoy when the enemy doesn't do so.
The requirement is that the collateral damage be deemed proportionate to the military advantage of the attack.
Considering the actions and declarations of Hamas, Israel's actions should be covered under these laws, uneducated pronouncements by various people notwithstanding.