Whom can be used instead of who when it is the object of a verb or preposition. It can be used in the following ways:
as a relative pronoun (referring back to a person and starting a relative clause): Students for whom English is a second language should consider taking the course.The book was written by his wife, Joan, whom he married in 1962. (starting a relative clause that is the subject, object, or complement of another clause): I don’t know whom you’ve already met.
as a question pronoun: Whom do you blame?
Whom is only used in written English and in formal spoken English. Who is normally used as the object of a verb or preposition, but immediately after a preposition whom is generally used: the man with whom she lived. It would, however, be more natural to say: the man she lived with.