I can never figure out whether I should use who and whom. Most people use who for both colloquially, but that’s not correct.
What’s the rule for using who and whom correctly?
The easy way to tell which is technically correct is to substitute he and him for who and whom, then rearrange the word order to see which sounds right.
“Who were you speaking to?” becomes “You were speaking to he” — which is clearly incorrect.
Short answer: When in doubt, use who. It's disconcerting to hear whom where who is expected, but the usage of who in situations where previously whom was standard has been increasing, especially in spoken usage.
Longer answer: The traditional rule is that whom was to be used in the "objective case". What this means in practice (it's even controversial whether English has cases), is that you try to answer the question: if the answer is he, she, they, I, we, etc., you use who. If the answer is him, her, them, me, us, etc., you use whom.
Someone using whom in place of who is likely to be interpreted as a hypercorrection from linguistic insecurity (and Geoff Pullum at the Language Log agrees), while using who in place of whom is, at worst, being too colloquial (and at best, being hip and cool!). Summary: it's good to know which is which and use them correctly, but when in doubt, use who.
"Whom remains in significant use following a preposition" but use in objective case is moribund. The Wikipedia article on "who" has a detailed explanation.
Who is used as the subject of a verb. It's a nominative pronoun. Example:
While writing a sentence, first find the verb(s). In this sentence, the verbs are was and Ben. Now find the subject of each verb: Ben and who. Since who is a subject, it's correct.
Whom is used as the object of the verb/preposition. It is an objective pronoun. Example:
In this case, the verb is asked. The object of the verb is whom. Therefore it is correct.
There is another way for this rule. Follow this link:
Basically, you use who if it's the subject or another name for it and whom if it's not.
Who is the subject.
Whomever is the object of the preposition to here, not the subject.
Since Bob is the subject and who is referring to Bob, then it's who.
Whom is the direct object here, so still not the subject.