A friend asked me today when to use “who” and when to use “whom.” It’s simple: it depends into which part of the sentence you need to put it. Use “who” when it’s in the “subject” and “whom” when it’s in the predicate (after the verb, or the object on which the verb acts).
Here’s a nice trick. Use the word “he” and see what happens.
He needs the book.
Substitute “who” for “he” and you get:
Who needs the book?
Now move the “he” to the other side of the verb, and conjugate accordingly.
Albert told him about the cat.
Then switch “whom” for “him.”
Albert told whom about the cat?
You can see that the nice little “m” on the end of the “him” is your clue that you need one for “whom” too. Look at these.
He sings the song softly.
Who sings the song softly?
The judge believed him innocent
The judge believed whom innocent?
It's easy, right? You can use this same substitution for plural, too, you just have to remember to change the verb accordingly.
The people are here. (He is here.)
Who is here?
You brought soup for these people? (You brought soup for him.)
You brought soup for whom?
There’s a bonus tip. If the tricky word is preceded by a preposition, it’s “whom” because then it’s necessarily part of the predicate (no matter where it lies in the sentence physically). Prepositions are words like at, for, by, to, with, from, under, and over. If your tricky word follows a preposition, it’s automatically “whom.”
The book was written by whom?
From whom did you get that cookie?
With whom did you go to the theater?
You threw the eggs at whom?
You can substitute “him” for all of those tail end “whoms.” It’s easy. Look for the preposition.