Leviticus 25:28

25:28 If he has not prospered enough to refund a balance to him, then what he sold will belong to the one who bought it until the jubilee year, but it must revert in the jubilee and the original owner may return to his property.

Leviticus 25:50

25:50 He must calculate with the one who bought him the number of years from the year he sold himself to him until the jubilee year, and the cost of his sale must correspond to the number of years, according to the rate of wages a hired worker would have earned while with him.