The correct sequence of events that led to the Communist Revolution in China is:
Nationalists overthrow dynastic rule > Communists help nationalists secure the cities > Nationalists purge the communists > Communists and nationalists fight the Japanese and each other > Communists overtake the nationalists after WWII.
So, the first response you provided is the correct one.