“These are the regulations you must present to Israel.
“If you buy a Hebrew slave, he may serve for no more than six years. Set him free in the seventh year, and he will owe you nothing for his freedom.
If he was single when he became your slave, he shall leave single. But if he was married before he became a slave, then his wife must be freed with him.
“If his master gave him a wife while he was a slave and they had sons or daughters, then only the man will be free in the seventh year, but his wife and children will still belong to his master.
But the slave may declare, ‘I love my master, my wife, and my children. I don’t want to go free.’
If he does this, his master must present him before God. Then his master must take him to the door or doorpost and publicly pierce his ear with an awl. After that, the slave will serve his master for life.
References for Exodus 21:6