35 “If your brother becomes poor and cannot maintain himself with you, you shall support him as though he were a stranger and a sojourner, and he shall live with you. 36 Take no interest from him or profit, but fear your God, that your brother may live beside you. 37 You shall not lend him your money at interest, nor give him your food for profit. 38 I am the Lord your God, who brought you out of the land of Egypt to give you the land of Canaan, and to be your God.
39 “If your brother becomes poor beside you and sells himself to you, you shall not make him serve as a slave: 40 he shall be with you as a hired servant and as a sojourner. He shall serve with you until the year of the jubilee. 41 Then he shall go out from you, he and his children with him, and go back to his own clan and return to the possession of his fathers. 42 For they are my servants,  whom I brought out of the land of Egypt; they shall not be sold as slaves. 43 You shall not rule over him ruthlessly but shall fear your God. 44 As for your male and female slaves whom you may have: you may buy male and female slaves from among the nations that are around you. 45 You may also buy from among the strangers who sojourn with you and their clans that are with you, who have been born in your land, and they may be your property. 46 You may bequeath them to your sons after you to inherit as a possession forever. You may make slaves of them, but over your brothers the people of Israel you shall not rule, one over another ruthlessly.
47 “If a stranger or sojourner with you becomes rich, and your brother beside him becomes poor and sells himself to the stranger or sojourner with you or to a member of the stranger's clan, 48 then after he is sold he may be redeemed. One of his brothers may redeem him, 49 or his uncle or his cousin may redeem him, or a close relative from his clan may redeem him. Or if he grows rich he may redeem himself. 50 He shall calculate with his buyer from the year when he sold himself to him until the year of jubilee, and the price of his sale shall vary with the number of years. The time he was with his owner shall be rated as the time of a hired servant. 51 If there are still many years left, he shall pay proportionately for his redemption some of his sale price. 52 If there remain but a few years until the year of jubilee, he shall calculate and pay for his redemption in proportion to his years of service. 53 He shall treat him as a servant hired year by year. He shall not rule ruthlessly over him in your sight. 54 And if he is not redeemed by these means, then he and his children with him shall be released in the year of jubilee. 55 For it is to me that the people of Israel are servants.  They are my servants whom I brought out of the land of Egypt: I am the Lord your God. (ESV)