That cannot head a relative clause when it is the object of a preposition which it directly follows—that is, when the preposition is 'pied-piped' with the relativizer to the beginning of the clause:
He worked for a spy network about ∗that I knew nothing. This must be written using which . . .
He worked for a spy network about okwhich I knew nothing.
In ordinary speech, that can head a relative clause if the preposition is not pied-piped but 'stranded' in its original position:
He worked for a spy network ok?that I knew nothing about.
Formal written English frowns on this; but formal written English frowns on stranding the preposition, too, although that's now far more common than it used to be.
And you should note that neither "rule" applies when the relativizer (which or that) is not the object of the preposition:
He took off his hat. This is the hat okthat he took off.
In this case hat is not the object of off but the Direct Object of take, and off is ...
- well, there's a lot of argument about that. Traditional grammar calls it an 'adverb'. Some modern grammarians call it a 'particle', and others call it an 'intransitive preposition'. I call it a locative complement.
In any case, it is not a preposition governing the relativizer, whether that's that or which, so it cannot be pied-piped—
This is the hat ∗off which he took.
It must remain stranded in its original position.