Who are the two Goyim?
Rashi: They are Yisrael and Yehudah.
Rashi based on Bereishis Rabah 67:8: Esav went to Yishmael to marry [Yishmael's daughter Machalas], and to incite him to contest Yitzchak's inheritance of Avraham. Yishmael will kill Yitzchak, and I (Esav), the Go'el ha'Dam for my father, will kill Yishmael. This is why he said "Yikrevu Yemei Evel Avi" (Bereishis 27:41) ? then I will inherit Yitzchak 1 and Yishmael 2 .
Shocher Tov 14:2: Esav intended to kill also Yakov, therefore, he alone would inherit Yitzchak.
Why would Esav inherit Yishmael? Yishmael had 12 sons (Bereishis 25:13-15)! We cannot say that all were born later - at least Yishmael's Bechor Nevayos was born before his daughter Machalas! Perhaps he intended to inherit a share due to Machalas. Or, he would say 'since Yishmael killed my father, I get all his property', like a king gets the property of a rebel who is executed. (PF)
What are the two lands?
Radak: (a) Eretz Yehudah and Binyamin, and (b) the land of the other Shevatim. They are called separate lands, just like they were separate kingdoms. It says "Tihyenah" (feminine) due to the last matter mentioned (ha'Aratzos, even though it applies also to ha'Goyim, which is masculine). We find like this - "Garei Veisi v'Amhosai l'Zar Tachshevuni" (Iyov 19:15), "Api va'Chamasi Niteches" (Yirmeyah 7:20). After, it says Yerashnuha (singular), for both lands are one, just the kingdom was divided after David 1 .
Seemingly he means after Shlomo, i.e. in the days of Rechav'am. (PF)
What do we learn from "va'Shem Sham Hayah"?
Rashi: He knows your thoughts 1 .
Radak: He heard their words, and 'paid' them on their heads.
Malbim: You think that you will inherit the two lands and also Hashem, who was there?! You say that Edom will enter in place of Yisrael for Yisrael profaned Hashem and you are the nation that Hashem chose!
Shocher Tov 14:2: Yishmael thought that Esav wants him to kill Yitzchak, and Esav will kill Yakov, and they will inherit Avraham together. Hashem knows that Esav intended to kill also Yishmael.