מִן־הַגּוֹיִ֗ם אֲשֶׁ֣ר אָֽמַר־יְהוָה֩ אֶל־בְּנֵ֨י יִשְׂרָאֵ֜ל לֹֽא־תָבֹ֣אוּ בָהֶ֗ם וְהֵם֙ לֹא־יָבֹ֣אוּ בָכֶ֔ם אָכֵן֙ יַטּ֣וּ אֶת־לְבַבְכֶ֔ם אַחֲרֵ֖י אֱלֹהֵיהֶ֑ם בָּהֶ֛ם דָּבַ֥ק שְׁלֹמֹ֖ה לְאַהֲבָֽה׃
of the nations concerning which the LORD said unto the children of Israel: ‘Ye shall not go among them, neither shall they come among you; for surely they will turn away your heart after their gods’; Solomon did cleave unto these in love.
Ibn Ezra
…God’s community meaning, he shall not be considered as one of God ’s community for purposes of marriage to an Israelite woman [Qiddushin 72b–73a]. The same applies to an Ammonite (but not an Ammonitess), and a Moabite (but not a Moabitess).