‘Que’ and ‘qui’ are both used to refer to things. Which one to use depends on what you are referring to. Use ‘que’ when you are referring to something that is the object of the sentence, which means something is happening to it. For example,’ La maison que j’aime…’ Here, the house is being liked, so it is the object. This means we use ‘que’. Use ‘qui’ when you are referring to something that is the subject of the sentence, which means it is doing something. For example,’ Le garçon qui aime le maison...’ Here, the boy is liking the house, so he is the subject. This means we use ‘qui’. A good rule of thumb is that if the word is followed by a verb, use ‘qui’. If it is followed by a pronoun (je, tu, il…) use ‘que’.