What exactly, did Hashem mean by "the fourth generation"?
Rashi and Targum Yonasan: The fourth generation starting from Yakov, who went down to Egypt - Yehudah 1 , Peretz, Chetzron and Kalev (who entered Eretz Yisrael).
Ramban and Rashbam: The fourth generation of the sinning Kena'anim, since it is the way of Hashem to "visit the sins of the fathers on the children, the grandchildren and the great-grandchildren", 2 to give them a chance 3 to do Teshuvah. 4
Riva: Why doesn't Yaakov count as the first generation? It is because he went to Mitzrayim shortly before he died. Also, the servitude began only after Yakov died (Rashi, Bereishis 47:28. Sifsei Chachamim resolves this with Shmos 1:6, which connotes that it was after all his sons died.)
Since they would not return until four hundred years, the number of generations (of Yisrael) makes no difference. In fact the four generations (of Kena'anim) plus the reason for the delay given in the Pasuk itself (their sin is not yet complete) explains why they had to wait four hundred years (Rashbam).
This proves that Teshuvah is applicable to Nochrim.
Why does the Torah mention specifically the Emori?
Ramban: a. They were the strongest of the Kena'ani nations. b. They were the first that Yisrael captured (Sichon and Og).
רש"י: צא וחשוב דורותיו: יחד עם יעקב היו חמישה דורות?
גור אריה: "דור רביעי" משמעו ארבעה דורות נוספים מאז שגלו, ויש למנות מבני יעקב ואילך. עיי"ש.