Here I’m not going to attempt to give rules of interpretation for when something in the Bible is or is not ordering genocide. However, I will point out a few problems with concluding that a verse that looks like it is commanding genocide is actually commanding it.
The language in the Bible is often imprecise and different than how we would use it today. For instance, the word for male “zakuwr” (H2138 ) sometimes just means men older than “infants” (see below)
13 and Jehovah thy God hath given it into thy hand, and thou hast smitten every male H2138 of it by the mouth of the sword. 14 Only, the women, and the infants, and the cattle, and all that is in the city, all its spoil, thou dost seize for thyself, and thou hast eaten the spoil of thine enemies which Jehovah thy God hath given to thee. 15 So thou dost do to all the cities which are very far off from thee, which are not of the cities of these nations. 16 `Only, of the cities of these peoples which Jehovah thy God is giving to thee [for] an inheritance, thou dost not keep alive any breathing; 17 for thou dost certainly devote the Hittite, and the Amorite, the Canaanite, and the Perizzite, the Hivite, and the Jebusite, as Jehovah thy God hath commanded thee, 18 so that they teach you not to do according to all their abominations which they have done to their gods, and ye have sinned against Jehovah your God.(Deuteronomy 20:13-18 YLT)
“Am” (H5971) for “people” can just mean “men” (seeming to exclude infants and very young children). It is also used in synonymously with “iysh” H376 (men) see below:
Before they lie down, the men H5971 of the city — men of Sodom — have come round about against the house, from young even unto aged, all the people from the extremity;(Gen 19:4)
And Absalom and all the people, H5971 the men H376 of Israel, have come in to Jerusalem, and Ahithophel with him,(2 Sa 16:15)
And the people, h5971 the men H376 of Israel, strengthen themselves, and add to set the battle in array in the place where they arranged themselves on the first day.(Jdg 20:22)
Here’s another example in war of “all the people coming out” when it is
really all the men:
`And we turn, and go up the way to Bashan, and Og king of Bashan cometh out to meet us, he and all his people, H5971 to battle, [to] Edrei. (Deu 3:1)
Also this kind of implies that the “am” (literally “people” but here meaning “men”) were counted separately from the women especially in wartime:
and he bringeth back the whole of the substance, and also Lot his brother and his substance hath he brought back, and also the women and the people. H5971(Gen 14:16)
Here the Amalekites come back later, so H5971 “am” “all the people” must not have been destroyed (king Agag is killed by Samuel later as well) First: Samuel hears a word from the lord that night then, second: Samuel rises early the next day to condemn Saul and kill Agag. This means Agag would have to impregnate a woman during the one day he was captured:
(1 Sa 15:8)
and he catcheth Agag king of Amalek alive, and all the people H5971 he hath devoted by the mouth of the sword;
Joshua uses “am” (h5971) or “people” to talk about the destruction of Ai which is a bit ambigous as to whether everything was destroyed or not:
16 And all the people h5971 that were in Ai were called together to pursue after them: and they pursued after Joshua, and were drawn away from the city.
17 And there was not a man left in Ai or Bethel, that went not out after Israel: and they left the city open, and pursued after Israel.
18 And the LORD said unto Joshua, Stretch out the spear that is in thy hand toward Ai; for I will give it into thine hand. And Joshua stretched out the spear that he had in his hand toward the city.
19 And the ambush arose quickly out of their place, and they ran as soon as he had stretched out his hand: and they entered into the city, and took it, and hasted and set the city on fire.
24 And it came to pass, when Israel had made an end of slaying all the inhabitants h3427 of Ai in the field, in the wilderness wherein they chased them, and when they were all fallen on the edge of the sword, until they were consumed, that all the Israelites returned unto Ai, and smote it with the edge of the sword. (Joshua 8:16-24)
(it does not mention anything about the women or the children being slain when they go into the city, it is fighting men, or people of fighting age, that are drawn out of the city and are slain)
However, it gets a little ambiguous in the next few verses:
24 And it came to pass, when Israel had made an end of slaying all the inhabitants h3427 of Ai in the field, in the wilderness wherein they chased them, and when they were all fallen on the edge of the sword, until they were consumed, that all the Israelites returned unto Ai, and smote it with the edge of the sword.(Joshua 8:24-27)
25 And so it was, that all that fell that day, both of men and women, were twelve thousand, even all the men of Ai.
26 For Joshua drew not his hand back, wherewith he stretched out the spear, until he had utterly destroyed all the inhabitants of Ai.
27 Only the cattle and the spoil of that city Israel took for a prey unto themselves, according unto the word of the LORD which he commanded Joshua.
The argument for “yashab” (H3427) “inhabitants” (which is used in Joshua 8:24) being just the men is much weaker, but there is still a possibility, such as here where it seems to separate out women and infants from the “inhabitants.” Also if they separated out women and infants in the command it shows that they did not normally kill women and infants in war which would go contrary to a lot of what is assumed about this bronze age culture in the Bible:
9 And the people numbered themselves, and lo, there is not there a man of the inhabitants H3427 of Jabesh-Gilead. 10 And the company send there twelve thousand men of the sons of valour, and command them, saying, `Go — and ye have smitten the inhabitants H3427 of Jabesh-Gilead by the mouth of the sword, even the women and the infants.(Judges 21:9-10)
Below you could read it as “smite the inhabitants” but “utterly destroy everything else in the city including the animals” In most translation the pronoun “it” is used instead of “them”, meaning the rest of the verse, could be referring to other things in the city. And in most translations it says “all that is therein” instead of “all who are therein”, meaning it is probably referring to people’s possessions. The word for smite is mostly used to talk about partial destruction, or attacking.
`Thou dost surely smite the inhabitants H3427 of that city by the mouth of the sword; devoting it, and all that [is] in it, even its cattle, by the mouth of the sword;(Deuteronomy 13:15)