If it does not make peace with you but makes war against you, then lay siege against that city.
Now if it answers you shalom and opens up to you, then all the people found in it will serve you as forced laborers.
When Adonai your God hands it over to you, you are to strike all its males with the sword.