Exodus 21:1-6 New Revised Standard Version (NRSV)
The Law concerning Slaves
21 These are the ordinances that you shall set before them:
2 When you buy a male Hebrew slave, he shall serve six years, but in the seventh he shall go out a free person, without debt. 3 If he comes in single, he shall go out single; if he comes in married, then his wife shall go out with him. 4 If his master gives him a wife and she bears him sons or daughters, the wife and her children shall be her master’s and he shall go out alone. 5 But if the slave declares, “I love my master, my wife, and my children; I will not go out a free person,” 6 then his master shall bring him before God.[a] He shall be brought to the door or the doorpost; and his master shall pierce his ear with an awl; and he shall serve him for life.
Leviticus 25:39-46 New Revised Standard Version (NRSV)
39 If any who are dependent on you become so impoverished that they sell themselves to you, you shall not make them serve as slaves. 40 They shall remain with you as hired or bound laborers. They shall serve with you until the year of the jubilee. 41 Then they and their children with them shall be free from your authority; they shall go back to their own family and return to their ancestral property. 42 For they are my servants, whom I brought out of the land of Egypt; they shall not be sold as slaves are sold. 43 You shall not rule over them with harshness, but shall fear your God. 44 As for the male and female slaves whom you may have, it is from the nations around you that you may acquire male and female slaves. 45 You may also acquire them from among the aliens residing with you, and from their families that are with you, who have been born in your land; and they may be your property. 46 You may keep them as a possession for your children after you, for them to inherit as property. These you may treat as slaves, but as for your fellow Israelites, no one shall rule over the other with harshness.