Today we’ll be talking about relative pronouns used as objects of prepositions. Of all the relative pronouns described in the preceding articles, only WHICH, WHOM and WHOSE can be used this way.
In formal language the preposition precedes the relative pronoun. Have a look at the following sentences, they’re very formal.

The man WITH WHOM she lives is her boss.
The building IN WHICH I live is very old.
My neighbor, FOR WHOSE husband I work, wants to study chemistry.
In less formal language we usually place the preposition at the end of the relative clause. We could rewrite the sentences above like so:

The man WHOM she lives WITH is her boss.
The building WHICH I live IN is very old.
My neighbor, WHOSE husband I work FOR, wants to study chemistry.
Besides, in less formal contexts we usually replace the pronoun WHOM by WHO or THAT if the preposition is at the end of the relative clause. The pronoun WHICH is often replaced by THAT in such a situation. The pronoun WHOSE can’t be replaced by any other pronoun.

The man WHO / THAT she lives WITH is her boss.
The building THAT I live IN is very old.
Also, in very informal speech the pronoun is omitted altogether.

The man she lives WITH is her boss.
The building I live IN is very old.