The choice between who and whom (or whoever and whomever) occurs primarily in subordinate clauses and in questions. Who and whoever, subjective-case pronouns, are used for subjects and subject complements. Whom and whomever, objective-case pronouns, are used for objects. (See 25a and 25b.)
An exception to this general rule occurs when the pronoun functions as the subject of an infinitive (see 25c). See also 24f.
Consult the chart in 25a for a summary of the trouble spots with who and whom.