As question words, que means what and qui means who, so it is easy to distinguish between them.
Que fait-il? – What is he doing?
Qui a fait cela? – Who did that?
However, as relative pronouns, qui and que sometimes cause confusion.
Qui is the subject of a verb, in other words the person or thing that is doing the verb:
C’est mon ami qui a ecrit ce livre. – It’s my friend who wrote this book.
J’ai vu la maison qui est à vendre. – I’ve seen the house that is for sale.
These examples show that qui can refer to persons or things, and can be translated as who or that in English. Note that the verb immediately follows qui in each sentence, which helps us to recognise qui as the subject of the verb.
Que is the object of a verb, as these examples show:
Il a lu le livre que j’ai ecrit. – He has read the book that I wrote.
C’est la dame que nous avons vue en ville hier. – It’s the woman whom/that we saw in town yesterday.
It is worth noting that in the previous two examples, we could omit the words ‘that’ and ‘whom’ in English (so we could say ‘He has read the book I wrote’) but it is not possible to omit que in French.
With thanks to Elizabeth Allen