Shemot / Exodus 29:46
וְיָדְעוּ כִּי אֲנִי יְהוָה אֱלֹהֵיהֶם אֲשֶׁר הוֹצֵאתִי אֹתָם מֵאֶרֶץ מִצְרַיִם לְשָׁכְנִי בְתוֹכָם אֲנִי יְהוָה אֱלֹהֵיהֶם׃
And they shall know that I am the Eternal their Almighty, who brought them out of the land of Egypt to dwell among them. I am the Eternal their Almighty.
Pshat פְּשָׁט
What the Exodus Was For
Rashi: "to dwell among them" means "on condition that I dwell among them". Ibn Ezra: then they will know that I took them out of Egypt only so that they would make Me a Mishkan and I would dwell among them. This is what was told to Moshe (Moses) at the mountain: "you shall serve the Almighty on this mountain".
How Rashi and Ibn Ezra explain it
Remez רֶמֶז
Egypt in the Middle
Rabbeinu Bahya: the exodus was on condition that God would dwell among Israel, and this is a need on High, not only of people. In the prophet Hoshea (Hosea), "from the land of Egypt" stands in the middle between "I am the Eternal" and "know no God but Me": I took you out so that you would accept Me. And by the midrash, Israel was redeemed from Egypt by the merit of the Mishkan. Lekach Tov: the second "I am the Eternal their Almighty" means He is faithful in reward.
How Rabbeinu Bahya and Midrash Lekach Tov explain it
Drash דְּרָשׁ
A Condition in Egypt
Midrash Tanchuma: Rabbi Yehoshua ben Levi said that the Holy One, blessed is He, set Israel a condition already in Egypt: He takes them out only so that they make a Mishkan and He settles His Presence among them. When the Mishkan stood, the condition was fulfilled. Haamek Davar: "and they shall know" is a further promise: not only to be His people, but to know it. As in the Mishnah: beloved are those called children, and more so those who were made to know it.
How Midrash Tanchuma and Haamek Davar explain it
Sod סוֹד
A Need on High
Ramban: Rashi explains "on condition of dwelling", and Ibn Ezra that the exodus was for the Mishkan, and this is well explained. If so, there is a great secret here: by the plain sense the Presence in Israel is a need of people, but it is as it says: "Israel, in whom I will be glorified". Recanati: through Israel, who serve as is fitting, the Presence says: for your sake, Israel, I unite with Beauty (תִּפְאֶרֶת).
How Ramban and Recanati explain it