Hi Uva@90,
When you say "just before the comma", do you mean "immediately before the comma" or "located somewhere in the phrase that appears before the comma?"
As a general rule, a pronoun should refer to the matching noun that precedes it (although if the pronoun is vague/ambiguous, then it's incorrect).
eg. Mike and Tom were both hungry, thus they decided to share his sandwich.
Here, the pronoun "they" clearly refers to "Mike and Tom", but the vague pronoun "his" is a problem, since we don't know whether "Mike" or "Tom" is the one with the sandwich.
In some rarer situations, the pronoun "it" is used without a preceding matching noun.
Are you dealing with any specific SC prompts that you're curious about?
GMAT assassins aren't born, they're made,
Rich