Defining and non-defining relative clauses begin with a relative pronoun which can sometimes be omitted:
We went to a beach (which/that) Jane had recommended to us.
Here the relative pronoun refers to "a beach", and the subject of the relative clause is "Jane". Compare:
I know a man who/that ran in the London Marathon last year.
where the relative pronoun refers to "a man", and the subject of the relative clause is also "a man".
In this case, the relative pronoun can not be omitted.
When we use a defining relative clause, the relative pronoun can be either the subject or the object of the relative clause.
When it is the subject the word order is subject + verb +object: I have a friend who/that plays guitar. (a friend = subject, plays = verb, guitar = object)
When the relative pronoun is the object the word order is object + subject + verb:
He showed me the rocks (which/that) he had collected. (the rocks = object, the = subject, had collected = verb).
Relative pronouns are used to add information in defining relative clauses as follows:
Adding information about things
|Relative pronoun||which||that||no relative pronoun|
Adding information about people
|Relative pronoun||who||that||no relative pronoun||whom|
When we add information about things, we can use that (or no relative pronoun) as object in conversation and which in more formal contexts:
Decorating is a job (that) I hate. (rather than "... which..." in this informal context)
When we add information about people, we generally prefer that (or no relative pronoun)
as object in informal contexts rather than who or whom:
That's the man (that) I met at Mary's party. (rather than ... who/whom I met...)
whom is very formal and rarely used in spoken English:
The boy whom Mary had shouted at smiled. (less formally that, no relative pronoun or who)
We use that as subject after: something and anything; words such as all, little, much, and none used as pronouns: and noun phrases that include superlatives.
Which is also used as subject after something and anything, but less commonly:
These walls are all that remain of the city. (not ... which remain of the city).
Note that we can use that (or no relative pronoun) as object after something/anything; all, etc.: and noun phrases with superlatives. For example:
She is one of the kindest people (that) I know. (not ...one of the kindest people who I know.)
Relative pronouns are used to add information in non-defining relative clauses as follows:
adding inforation about things
adding information about people
Notice that we must include a relative pronoun in a non-defining relative clause.
We can use who or whom as object, although whom is very formal:
Professor Thompson, who(m) I have long admired, is to visit the University next week.
When we add information about things, we can use which as subject or object. That is something used instead of which, but some people think this is incorrect:
The Master's course, which I took in 2010, is no longer taught. (or ...that I took...)