Thats different to a military conflict where you are legally allowed to target and kill people you believe to be enemy combatants. Its up to Iran to protect their civilans at the end of the day. Im not even sure this should be prosecuted as a war crime since Iran does not participate in the international law of armed conflict.