Exodus 21:2-6

2 aWhen you buy a Hebrew slave,
Or servant; the Hebrew term  ‘ebed designates a range of social and economic roles; also verses 5, 6, 7, 20, 21, 26, 27, 32 (see Preface)
he shall serve six years, and in the seventh he shall go out free, for nothing.
3If he comes in single, he shall go out single; if he comes in married, then his wife shall go out with him. 4If 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. 5But cif the slave plainly says, ‘I love my master, my wife, and my children; I will not go out free,’ 6then his master shall bring him to dGod, and he shall bring him to the door or the doorpost. And his master shall bore his ear through with an awl, and he shall be his slave forever.

Deuteronomy 15:12-18

12 eIf your brother, a Hebrew man or a Hebrew woman, is sold
Or sells himself
to you, he shall serve you six years, and in the seventh year you shall let him go free from you.
13And when you let him go free from you, you shall not let him go empty-handed. 14You shall furnish him liberally out of your flock, out of your threshing floor, and out of your winepress. gAs the Lord your God has blessed you, you shall give to him. 15 hYou shall remember that you were a slave in the land of Egypt, and the Lord your God redeemed you; therefore I command you this today. 16But iif he says to you, ‘I will not go out from you,’ because he loves you and your household, since he is well-off with you, 17then you shall take an awl, and put it through his ear into the door, and he shall be your slave
Or servant; the Hebrew term  ‘ebed designates a range of social and economic roles (see Preface)
forever. And to your female slave
Or servant
you shall do the same.
18It shall not seem hard to you when you let him go free from you, for at half the cost of a hired worker he has served you six years. So the Lord your God will bless you in all that you do.

Copyright information for ESV