My criterion is pre-1945 body count for the governments in question, including non-military actions (like the Holocaust of the Jews, Gypsies, and Slavs; and the Holodomor of the Ukranians) as well as military. It doesn't matter whether or not you count Operation Keelhaul, the campaign against "rootless internationalists," and the like: Stalin worked more people to death in the GULAG network (and starved to death in the special settlements) than Hitler gassed (and worked to death: the Nazi concentration camps were modeled on their Soviet counterparts) in the Holocaust.
The Communists targeted class enemies, while the Nazis targeted racial ones, but this was a less important distinction than you think: if you were a kulak and became poor, you were now a poor kulak, not a proletarian... and in practice, Lenin and especially Stalin managed to off an awfully large number of race enemies anyways.
Edit: For the "worst _criminals_" part, as opposed to "worst faction": look at the crimes that the Nazis committed, that the Japanese committed, and that the Western Allies committed; Stalin committed crimes of the same categories, including crimes which one of these three groups did commit and the other two did not. The Winter War was Stalin's Manchuria; Berlin was his Nanking; his artillery bombardments of cities were his strategic bombing; the Molotov-Ribbentrop Pact was his Molotov-Ribbentrop Pact; his extermination of the Ukranians and the kulaks was his Holocaust (remember: a kulak was a class enemy, but a kulak who became poor was now a poor kulak, not a proletarian); and he committed the Katyn Forest massacre, which was on a larger scale than any comparable massacre done by anyone else.