In the four sentences, there are two distinct words spelled as that. The first one is a demonstrative pronoun (a deictic). It’s like when you point at something that you consider to be either near or far. (“Not that one, this one.”) The second that is a relative pronoun.
Restrictive vs. non-restrictive refers to only the second that (For restrictive we don’t use the commas to indicate only one referent as opposed to another possible referent. Emphasis on possible.)
Don’t use that for non-restrictive relative clauses.
In both spoken and written English—except in only the most formal situations (academic writing, or giving a speech in front of the president)—we use that or who in restrictive clauses. In speech usually people communicate the “comma/s” in non-restrictive clauses by pausing.
EXAMPLES:
I have two sisters. My older sister, [del]that[/del] who lives in Malibu, has a big snake.
I have two sisters. The older sister, [del]that[/del] who lives in Malibu, has a big snake.
(The other sister is younger, but it could be that she also lives in Malibu–non-restrictive.)
I have two sisters. The sister that / who lives in Malibu has a big snake.
(The other sister definitely doesn’t live in Malibu or have a big snake–restrictive.)
Whom is for object case and people only. EX: “That is a man whom I can’t understand.”
Which is another relative pronoun. You can use it like that, but also in a non-restrictive clause, and some people consider it more formal.
So the quiz is wrong so say that letter C is incorrect, unless it’s going by only the most formal standard–a standard that is rarely applied today. I suppose if it’s a test for proofreaders at an academic press, it might apply.
If you heard the following conversation, or read it in a play, would it seem ungrammatical to you? Not to me.
EXAMPLE:
A: After you left the club, I got the girl’s phone number.
B: Really? But I thought she was married.
A: No, that’s the girl that lives in my building.
I’m talking about the girl that works at the Whiskey.
B: Oh. I see.