If you look in a grammar book, you’ll find the following advice on when to use who and when to use whom. Who is a nominative pronoun and whom is an objective pronoun.
Understand? Unless you’re an English teacher, probably not. So back to the grammar book for nominative and objective pronouns. A nominative pronoun is the subject of the sentence; for example, “He hit a homerun.” (“He” is doing the action.) An objective pronoun is the object of the preposition in a sentence: “The home run was hit by him.” (“Him” is the object of the sentence.) It follows the verb and is acted upon, not performing the action.
But it might be easier to remember by using the alliterative words he who and him whom. You can replace the he with who and the him with whom and it makes sense.
“Who hit the homerun?”
“He hit the homerun.”
“The homerun was hit by whom?”
“The homerun was hit by him.
Now how about who’s and whose? This is easier to explain. Who’s is a contraction of “who is,” or “who has”; and whose is a possessive pronoun, indicating ownership.
“Who’s the moron who slept through his own car alarm?”
“Whose car alarm went off at two in the morning and woke me from a pleasant dream?"
Abbott: Who is on first.
Costello: Well, what are you askin' me for?
Abbott: I'm not asking you--I'm telling you. Who is on first.
Costello: I'm asking you--who's on first?
Abbott: That's the man's name.