Exodus 21:1-4 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.