Knowing when to use the subjunctive is a complex affair that confuses even fluent french speakers at times. It has its subtleties, but a good trick is sticking to what makes sense, rather than applying a rigid set of rules.One of its main uses is to express doubt. For instance, consider the two examples below1) Indicative:"Je pense qu'il est venu" = I think that he came [which shows certainty]2)Subjunctive "Je ne pense pas qu'il soit venu"=I do not think that he came [which shows doubt]Other uses of the subjunctive include for imperative statements, expressing wishes, and exclamative statements. It also has other, less common uses that I would cover in another question pertaining to more specific uses.