There were other smaller armed groups aside from Hamas that infiltrated which were a lot less informed nor caring about any rules.
Hamas trained soldiers didn’t intentionally shoot any children. The very low child death rate compared to adults is direct evidence for this. And they have stated it is against their policy. (Hamas definitely shot some adults intentionally though).