Is it true that 同志 has some different meaning? Like gay (as in homosexual) or something? I know that during the 20th century in China and communist Russia it was very common to call people 同志 (товарищ, comrade). So is it wrong to call someone 同志 in China nowadays?
Yes it is true. The official word for somebody who is gay is 同性恋者 (tóngxìngliànzhě), but in recent years 同志 (tóngzhì) is frequently used as slang for somebody who is gay.
The most relevant parts:
In 1989, the Hongkonger 林奕华 named the first edition of his gay film festival "香港同志电影节"
From then on, in China and other Chinese speaking parts such as Taiwan, Hong kong, Singapore, Malaysia, “同志” gradually became the name for gays (and lesbians).
Further on the same page you can read:
In recent years after the introduction in China most young people stopped to use the word “同志” due to its implicit meaning.
Despite its implicit meaning in China which is known and used my more and more people, the official Chinese media (in the mainland) and official documents don't accept this meaning.
I'm not sure in what instance you'd be using 同志 nowadays anyway. Are you in the army? Do you actually have comrades? Or is this purely hypothetical?
From my experience with the language, if you want to call someone gay, people would say:
他是个同性恋 - tong2 xing4 lian4
Or, to say someone is not necessarily gay, but they're acting effeminate:
他很娘娘腔 niang2 niang qiang1, or simply, 他很娘
断袖之癖 duan4 xiu4 zhi1 pi3
(Actually, this idiom has a pretty neat back story. Basically, Emperor Han Ai Di was in bed with his man lover Dong Xian, and had to attend a court audience that morning. Not wishing to awaken Dong Xian, whose head was resting on the emperor's robe's sleeve, he had to cut the sleeve off (断袖)).
"同志" literally refers to someone else with a "common" purpose (with you). During the Maoist era, the connotation was "comrade," in the context of "Communist" or "party member."
Nowadays, the connotation may be that GENDER is what someone (and a lover) may have in common. That would translate into "homo" or "gay."