‘He’ DID know where they were but was polite to ask. God didn’t haven doesn’t have a human body but ‘his’ presence was noticeable, as it says on several occasions throughout the stories in the Bible.
This refers to in the meaning of that God would never even think of commanding such a evil thing bc God is LOVE personified, but he is also a God of Justice n the wars fought in the Old Testament was justified wars bc those people did not follow God’s laws nor were they willing to repent.