Why are The Edomim and the Mitzri'im permitted after two generations, whereas Amon and Mo'av are forbidden forever?
Ramban: Because we were sojourners in Egypt in the time of famine and because they honored our father Ya'akov, and appointed one of his children viceroy, and because they sons of the same father (Yitzchak).
It is not clear however, how Amon caused Yisrael to sin? Moreover, in Pasuk 10, the Torah gives a different reason as to why Edomim and Mitzri'im are permitted after two generations? Refer to 23:9:2:2.
Rashi: Since killing a person takes him out of this world, whereas causing him to sin takes him out of the world to come.
From when does one reckon the third generation?
Ramban (citing Yevamos, 78a): It is reckoned (not from the days of Moshe, but) from the time that the person in question converted.