Despite persistent reports to the contrary, this one is still with us:
Harbrace 5c: Use whom for all pronouns used as objects in formal written English.
For example, use whom as the object of the verb or preposition in formal written English.
NOT They voted for the person who they trusted.
USE They voted for the person whom they trusted. [object of the verb trusted]
NOT He is unsure who the message was intended for.
USE He is unsure whom the message was intended for. [object of the preposition for]
In subordinate clauses, use whom as the object of the verb or preposition.
NOT Richard told David who to call. Richard told David to call who? .
USE Richard told David whom to call. Richard told David to call whom? [object of the infinitive to call]
NOT The artist who she loved has gone away.
USE The artist whom she loved has gone away. [object of the verb loved in the relative clause whom she loved.]
NOT This is a friend who I write to once a year.
USE This is a friend whom I write to once a year. [object of the preposition to in the relative clause]
Whom may be omitted (or that subtituted) in sentences where no misunderstanding would result.
The friend he relied on moved away.
This is a person I try to avoid.
Note: In informal English, the pronoun who is commonly used when it occurs as the first word in the sentence, even when it is the object of a verb or preposition. As always, consider your audience.
Who do you want? Who is the gift for?