Leviticus 25:40-50

40 Rather, you are to treat him like an employee or a tenant; he will work for you until the year of yovel.
41 Then he will leave you, he and his children with him, and return to his own family and regain possession of his ancestral land.
42 For they are my slaves, whom I brought out of the land of Egypt; therefore they are not to be sold as slaves.
43 Do not treat him harshly, but fear your God.
44 "'Concerning the men and women you may have as slaves: you are to buy men- and women-slaves from the nations surrounding you.
45 You may also buy the children of foreigners living with you and members of their families born in your land; you may own these.
46 You may also bequeath them to your children to own; from these groups you may take your slaves forever. But as far as your brothers the people of Isra'el are concerned, you are not to treat each other harshly.
47 "'If a foreigner living with you has grown rich, and a member of your people has become poor and sells himself to this foreigner living with you or to a member of the foreigner's family,
48 he may be redeemed after he has been sold. One of his brothers may redeem him;
49 or his uncle or his uncle's son may redeem him; or any near relative of his may redeem him; or, if he becomes rich, he may redeem himself.
50 He will calculate with the person who bought him the time from the year he sold himself to him to the year of yovel; and the amount to be paid will be according to the number of years and his time at an employee's wage.
Complete Jewish Bible Copyright 1998 by David H. Stern. Published by Jewish New Testament Publications, Inc. All rights reserved. Used by permission.