A relative clause adds extra information about a noun - "the man who lives here," "the apartment that I saw." German reuses der/die/das as relative pronouns, and pushes the verb to the end, exactly like a weil-clause.
The relative pronoun matches the gender of the noun it describes, and its case depends on its role inside the relative clause itself:
| Gender | Nominative (subject of the clause) | Accusative (object of the clause) |
|---|---|---|
| masculine | der | den |
| feminine | die | die |
| neuter | das | das |
| plural | die | die |
Der Mann, der hier wohnt, ist mein Nachbar. (The man who lives here is my neighbor - "der" is the subject inside the clause, so nominative.)
Die Wohnung, die ich gesehen habe, ist teuer. (The apartment that I saw is expensive - "die" is the object inside the clause, so accusative.)
A relative clause is always set off by commas, and the conjugated verb always lands at the end of the clause - the same word-order shift you already learned for weil (Lesson 26).
Ignore the main sentence - look only at the relative clause itself. If the noun is doing the action inside that clause, use nominative (der/die/das). If it's receiving the action, use accusative (den/die/das).
Cross-checked against the Goethe-Institut A1 practice materials.