Leviticus 25:39-46
39 “‘If one of your countrymen becomes poor among you and sells himself to you, do not make him work as a slave.
40 He is to be treated as a hired worker or a temporary resident among you; he is to work for you until the Year of Jubilee.
41 Then he and his children are to be released, and he will go back to his own clan and to the property of his forefathers.
42 Because the Israelites are my servants, whom I brought out of Egypt, they must not be sold as slaves.
43 Do not rule over them ruthlessly, but fear your God.
44 “‘Your male and female slaves are to come from the nations around you; from them you may buy slaves.
45 You may also buy some of the temporary residents living among you and members of their clans born in your country, and they will become your property.
46 You can will them to your children as inherited property and can make them slaves for life, but you must not rule over your fellow Israelites ruthlessly.