"And when you make a sale to your fellow [or buy from the hand of your fellow], let none of you deceive" (Leviticus 25:14). That you should not deceive one another, for I too have sold. When? At the time when Abraham observed the commandments of the Holy One, blessed be He. Before the Torah was given, Abraham our father observed it [and kept all the commandments that are in the Torah. Rabbi Samuel bar Nahman said in the name of Rabbi Alexandra: Abraham observed even the eruv of cooked dishes, as it is said, "Because (eqev) Abraham obeyed My voice and kept My charge" (Genesis 26:5). What is eqev? Rabbi Simeon ben Lakish said: At the age of three years Abraham recognized the Holy One, blessed be He. How so from eqev? Ayin is seventy, qof is one hundred, bet is two — behold, one hundred and seventy-two. And Abraham lived one hundred and seventy-five; subtract from them three, when he was a small child — behold, at the age of three years Abraham recognized the Holy One, blessed be He]. When the Holy One, blessed be He, saw how Abraham cherished the commandments, He began to make over to him the upper realms and the lower realms, as it is said, "Blessed be Abram of God Most High, [Maker of heaven and earth" (Genesis 14:19), and so it says, "For all the land that you see, to you I will give it"] (Genesis 13:15). The Holy One, blessed be He, said: The whole world is entirely Mine, and I sold it to Abraham because he observed My commandments. But you, through your iniquities, have caused Me to become [like] a resident who rented a house from its owners, for so Jeremiah said, "Why should You be like a stranger in the land?" (Jeremiah 14:8). And when you sinned before Me, I sold you, as it is said, "You sell Your people for no wealth" (Psalms 44:13). Therefore, if a person needs to sell a house or a field or an article, you shall not deceive one another. Thus it is said, "Let none of you deceive his brother" (Leviticus 25:14), "and you shall not deceive one another, his fellow" (Leviticus 25:17).
Why God Sold the Whole World to Abraham Who Kept the Law
Midrash Tanchuma Buber, Behar 3:1
וכי תמכרו ממכר לעמיתך [או קנה מיד עמיתך] אל תונו (ויקרא כה יד). שלא תהיו מונים זה לזה, שאף אני מכרתי, אימתי בשעה ששמר אברהם מצותיו של הקב"ה, עד שלא ניתנה התורה שמרה אברהם אבינו [ושימר כל המצות שבתורה, אמר ר' שמואל בר נחמן בשם ר' אלכסנדרא אפילו עירובי תשבילין שימר אברהם, שנאמר עקב אשר שמע אברהם בקולי וישמור משמרתי וגו' (בראשית כו ה), מהו עקב, אמר ר' שמעון בן לקיש בן ג' שנים הכיר אברהם להקב"ה, מנין עק"ב, ע' שבים, ק' מאה, ב' שתים, הרי מאה ושבעים ושתים, וחיה אברהם מאה ושבעים וחמש, צא מהם ג' שהיה קטן, הרי בן ג' שנים הכי אברהם להקב"ה], כיון שראה הקב"ה היאך חיבב אברהם את המצות, התחיל מקנה לו העליונים והתחתונים, שנאמר ברוך אברם לאל עליון [קונה שמים וארץ (שם יד יט), וכן הוא אומר כי את כל הארץ אשר אתה רואה לך אתננה] (שם יג טו), אמר הקב"ה כל העולם כולו שלי הוא, ומכרתי אותו לאברהם, על ששימר מצותי, ואתם גרמתם בעונותיכם] לי להיות [דומה] לתושב ששכר בית מבעליו, שכן ירמיה אמר למה תהיה כגר בארץ (ירמיה יד ח), וכשחטאתם לפני מכרתי אתכם, שנאמר תמכור עמך בלא הון וגו' (תהלים מד יג), לפיכך אם צריך אדם למכור בית או שדה או חפץ, לא תהיו מונין זה את זה. לכך נאמר לא תונו איש את אחיו (ויקרא כה יד), ולא תונו איש את עמיתו (שם שם יז).