And yet so far as I know no Communist country (with the exception of "Democratic Kampuchea" under the Khmer Rouge) actually got around to doing it.
Lenin legalized homosexuality? Didn't that last about five minutes before they found out you can't run a country like that?
Castro (like Hamas) was a "notorious homophobe" but that didn't bother his homosexual fans.
In terms of laws, the USSR’s legality of homosexuality lasted from 1922 to 1933. Of course, it was not widely accepted in most parts of that empire.