Exodus 21:3-6 Christian Standard Bible (CSB)
3 If he arrives alone, he is to leave alone; if he arrives with[a] a wife, his wife is to leave with him. 4 If his master gives him a wife and she bears him sons or daughters, the wife and her children belong to her master, and the man must leave alone.
5 “But if the slave declares, ‘I love my master, my wife, and my children; I do not want to leave as a free man,’ 6 his master is to bring him to the judges[b] and then bring him to the door or doorpost. His master will pierce his ear with an awl, and he will serve his master for life.