Comment by golergka
This is war. Any hostile action in armed conflict can, and will, have collateral damage to the innocent. Acts of terror and war crimes are determined by who is targeted, what precautions are taken to minimise collateral damage, and how significant is the military target compared to expected collateral damage.
If you don't want to kill any innocent civilians, your only course of action is not to offer any resistance to people who attack you and surrender.
That last paragraph is disingenuous at best because there is a miles-wide valley of options between setting off explosives in peoples' pockets and surrender.