John Gill's Exposition of the Whole Bible
Leviticus 25:40
[But] as an hired servant,.... Who is hired by the day, or month, or year; and, when his time is up, receives his wages and goes where he pleases, and while a servant is not under such despotic power and government as a slave is:
[and] as a sojourner; an inmate, one that dwells in part of a man's house, or boards and lodges with him, and whom he treats in a kind and familiar manner, rather like one of his own family than otherwise:
he shall be with thee; as under the above characters, and used as such: this the Jews refer to food and drink, and other things, as they do,
Deuteronomy 15:16; and say q that a master might not eat fine bread, and his servant bread of bran; nor drink old wine, and his servant new; nor sleep on soft pillows and bedding, and his servant on straw: hence, they say r, he that gets himself an Hebrew servant is as if he got himself a master:
[and] shall serve thee unto the year of the jubilee; and no longer; for if the year of jubilee came before the six years were expired for which he sold himself, the jubilee set him free, as Jarchi observes; nay, if be sold himself for ten or twenty years, and that but one year before the jubilee, it set him free, as Maimonides says s.
q Maimon. in Misn. Kiddushin, c. 1. sect. 2. r Ibid. s Hilchot Abadim, c. 2. sect. 3.