'Qui' comes after a subject, however 'que' comes after the object of the sentence. The following examples will demonstrate this:Je cherche quelqu'un qui parle anglais. Here, 'quelqu'un' is the subject performing the action, therefore 'qui' will follow it.J'ai lu la brochure que tu m'as donnée. However, in this sentence, 'la brochure' is the direct object, because I am performing an action with it-by reading it. Additionally, note that the verb after 'que' will require a number and gender agreement that conforms to the number and gender of the noun that precedes 'que.' For example, in this sentence, 'la brochure' is a feminine and singular noun, therefore 'donnée' simply needs to be feminine and singular.