"Here are some other instructions you must present to Israel:
"If you buy a Hebrew slave, he is to serve for only 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 and then married afterward, only he will go free in the seventh year. But if he was married before he became a slave, then his wife will be freed with him.
"If his master gave him a wife while he was a slave, and they had sons or daughters, then the man will be free in the seventh year, but his wife and children will still belong to his master.
But the slave may plainly declare, 'I love my master, my wife, and my children. I would rather not go free.'
If he does this, his master must present him before God. Then his master must take him to the door and publicly pierce his ear with an awl. After that, the slave will belong to his master forever.
References for Exodus 21:6
"When a man sells his daughter as a slave, she will not be freed at the end of six years as the men are.
If she does not please the man who bought her, he may allow her to be bought back again. But he is not allowed to sell her to foreigners, since he is the one who broke the contract with her.
And if the slave girl's owner arranges for her to marry his son, he may no longer treat her as a slave girl, but he must treat her as his daughter.
If he himself marries her and then takes another wife, he may not reduce her food or clothing or fail to sleep with her as his wife.
If he fails in any of these three ways, she may leave as a free woman without making any payment.