you explained the old covenant in a few lines, the new covenant is very easy to explain;
Jer 31:31 Behold, the days come, saith the LORD, that I will make a new covenant with the house of Israel, and with the house of Judah:
Jer 31:32 Not according to the covenant that I made with their fathers in the day
that I took them by the hand to bring them out of the land of Egypt; which my covenant they brake, although I was an husband unto them, saith the LORD:
Jer 31:33 But this shall be the covenant that I will make with the house of Israel; After those days, saith the LORD, I will put my law in their inward parts, and write it in their hearts; and will be their God, and they shall be my people.
Jer 31:34 And they shall teach no more every man his neighbour, and every man his brother, saying, Know the LORD: for they shall all know me, from the least of them unto the greatest of them, saith the LORD: for I will forgive their iniquity, and I will remember their sin no more.
Jer 31:35 Thus saith the LORD, which giveth the sun for a light by day,
and the ordinances of the moon and of the stars for a light by night, which divideth the sea when the waves thereof roar; The LORD of hosts
is his name:
Jer 31:36 If those ordinances depart from before me, saith the LORD,
then the seed of Israel also shall cease from being a nation before me for ever.
Jer 31:37 Thus saith the LORD; If heaven above can be measured, and the foundations of the earth searched out beneath, I will also cast off all the seed of Israel for all that they have done, saith the LORD.
As for the old covenant, foreigners, hired servants and sojourners could be part of the old covenant, they could follow the Israelites and live with them if they followed the law of Moses; see exodus 24: 43-51.