Leviticus 25:27-28

25:27 he is to calculate the value of the years it was sold, refund the balance to the man to whom he had sold it, and return to his property. 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.