Leviticus 25:52-55

25:52 but if only a few years remain until the jubilee, he must calculate for himself in keeping with the remaining years and refund it for his redemption. 25:53 He must be with the one who bought him like a yearly hired worker. The one who bought him must not rule over him harshly in your sight. 25:54 If, however, he is not redeemed in these ways, he must go free in the jubilee year, he and his children with him, 25:55 because the Israelites are my own servants; they are my servants whom I brought out from the land of Egypt. I am the Lord your God.