Deuteronomy 20:10-11

20:10 When you approach a city to wage war against it, offer it terms of peace. 20:11 If it accepts your terms and submits to you, all the people found in it will become your slaves.