If they accept your terms and open the gates to you, then all the people inside will serve you in forced labor.
But if they refuse to make peace and prepare to fight, you must attack the town.
When the LORD your God hands the town over to you, use your swords to kill every man in the town.
But you may keep for yourselves all the women, children, livestock, and other plunder. You may enjoy the plunder from your enemies that the LORD your God has given you.
“But these instructions apply only to distant towns, not to the towns of the nations in the land you will enter.
In those towns that the LORD your God is giving you as a special possession, destroy every living thing.
You must completely destroy the Hittites, Amorites, Canaanites, Perizzites, Hivites, and Jebusites, just as the LORD your God has commanded you.
This will prevent the people of the land from teaching you to imitate their detestable customs in the worship of their gods, which would cause you to sin deeply against the LORD your God.
“When you are attacking a town and the war drags on, you must not cut down the trees with your axes. You may eat the fruit, but do not cut down the trees. Are the trees your enemies, that you should attack them?
You may only cut down trees that you know are not valuable for food. Use them to make the equipment you need to attack the enemy town until it falls.