What does « qui » do in a sentence like « J'ai un ami qui habite à Rome »?
It links two ideas and is the subject of the next verb. It can refer to people or things. J'ai un ami. Il habite à Rome. → J'ai un ami qui habite à Rome. (I have a friend. He lives in Rome. → I have a friend who lives in Rome.)
What does « que » do in a sentence like « Le livre que je lis est intéressant »?
It links two ideas and replaces the object of the next verb (the thing or person that someone sees, reads, likes…). After « que », you usually find a subject (je, tu, Paul…), then the verb. « que » becomes « qu' » before a vowel; « qui » never changes. Je lis un livre. Il est intéressant. → Le livre que je lis est intéressant. (I'm reading a book. It's interesting. → The book I'm reading is interesting.)
Where does the « qui » or « que » part go in the sentence?
Right after the noun it describes, even when that noun starts the sentence. The rest of the sentence comes after it. Le pain que tu achètes est très bon. (The bread you buy is very good.)
What does « où » refer to after a noun?
A place (where), or a moment in time (when). C'est le parc où je cours le matin. (It's the park where I run in the morning.) Le jour où il est arrivé, il pleuvait. (The day he arrived, it was raining.)
How do you choose between « qui » and « que »?
« qui » is the subject of the verb in its clause. « que » is the direct object: the clause has its own subject (je, tu, Paul…). A simple clue: a verb often comes right after « qui », and a subject right after « que ». But an object pronoun can come between « qui » and the verb. la femme qui parle (the woman who is talking) le film qui lui plaît (the film he likes) la femme que je connais (the woman I know)
Common mistakes
« Qui » is the subject of the next verb, « que » is the object: « l'ami qui parle », « l'ami que je vois ».
« Que » becomes « qu' » before a vowel, but « qui » never changes.
« Où » also works for time: « le jour où je suis arrivé ».