Who is used as the subject of a sentence.
Whom is used as an object in a sentence.
_________________________
Who was at the conference?
Whom did you see at the conference?
In the first sentence above, who is the subject.
In the second sentence, you is the subject and whom is the direct object (of who was at the conference).
_________________________
Who is the book dedicated to? Who is the subject.
To whom is the book dedicated? Whom is the object (of the book).
_________________________
A practically fail-proof exercise to help determine which is correct to use is to replace the word in question with he/she or him/her.
He/she is the equivalent of who (subjective) and him/her is the equivalent of whom (objective). For example:
Who/Whom should I ask to review the book?
I should ask he/she...
I should ask him/her...
I should ask him/her to review the book is right. Therefore, Whom should I ask to review the book? is the correct choice.
________________________
Whom is also used as the object of prepositions - words such as to, for, about, over, of, after, from or before. If one of these prepositions is present, it will precede the word whom.
Examples
The letter should begin with, "To Whom It May Concern."
For Whom the Bell Tolls.
About whom should I write to book?
The heated discussion was over whom?
You indicated the book was a biography of whom?
After whom do I give my presentation?
From whom do you expect to receive a good review?
Before whom do I stand in line?
________________________
SYNOPSIS
Who is used as the subject of a sentence.
Whom is used as an object in a sentence.
Substituting he/him or she/her is an excellent exercise in determining which word to use.
Whom is used when followed by prepositions such as to, for, about, over, of, after, from or before.
How the sentence is structured can change which word you use.
Whom in many situations is more formal than who. You can say:
"Who are you talking to?" or
"To whom are you talking?" (Notice the word to before whom.)