Since one of them was waving a white flag, he probably thought they were surrendering Hamas.
There has to be an indicator that the people shot were a threat before opening fire.