Follow the Rules of War. Geneva Convention. And no, not everybody does or will. In fact, most fail at it to varying degrees.
Nevertheless, it must be followed or the individuals who do not will be tried for War Crimes, whatever side they’re on.
Remember that War Crimes committed NOT by groups with names, flags and a catchy theme song
(I found the HAMAS theme song on archive from 2010 and wow, it’s a catchy tune; i can see why it recruited a lot of young people into it)
but by individuals. And individuals will be found and tried.