"Suppose you buy a Hebrew servant. He must serve you for six years. But in the seventh year, you must set him free. He does not have to pay anything.
References for Exodus 21:2
"If he does not have a wife when he comes, he must go free alone. But if he has a wife when he comes, she must go with him.
Suppose his master gives him a wife. And suppose she has sons or daughters by him. Then only the man will go free. The woman and her children will belong to her master.
"But suppose the servant says, 'I love my master and my wife and children. I don't want to go free.'
Then his master must take him to the judges. He must be taken to the door or doorpost of his master's house. His master must poke a hole through his ear lobe into the doorpost. Then he will become his servant for life.
"Suppose a man sells his daughter as a servant. Then she can't go free as male servants do.
"But what if the master who has chosen her does not like her? Then he must let the man buy her back. He has no right to sell her to strangers. He has broken his promise to her.
"What if he chooses her to get married to his son? Then he must grant her the rights of a daughter.
"What if he marries another woman? He must still give the first one her food and clothes and make love to her.
If he does not provide her with those three things, she can go free. She does not have to pay anything.