Grammarly [www.grammarly.com] gave the following rules that will help us learn how to use who and whom properly.
In a sentence, who is used as a subject. Let’s look at a couple of examples:
Whom is used as the object of a verb or preposition. Consider these examples:
The Difference Between Who and Whom
How can you tell when your pronoun is the object of a verb or preposition? Try substituting “he” or “she” and “him” or “her.” If “he” or “she” fits, you should use who. If “him” or “her” fits, you should usewhom. Keep in mind that you may have to temporarily rearrange the sentence a bit while you test it.