“Who” and “whom” are relative pronouns, and the trick for choosing the right one is to switch the clause around so that you can substitute a personal pronoun. Personal pronouns have a property called case. “I,” “he,” “she,” “we,” and “they” are in the nominative case, and function as subjects of a sentence or a clause. “Me,” “him,” “her,” “us,” and “them” are in the objective case, and are used as direct objects, indirect objects, and objects of a preposition. Your ear will tell you which personal pronoun is correct.