<p>I’m probably getting the terminology wrong, but think of it this way: whoever is a subject and whomever is an object. It’s the same as whom versus who.</p>
<p>They gave the award to him/her/me. To whom was the award given?? </p>
<p>He/she/I gave the award to them. Who gave the award?</p>
<p>Whoever gave out the award looked very pleased.</p>
<p>Whomever the award was given to looked very pleased.
^Notice that whom/whomever usually requires a preposition, in this case “to.”</p>
<p>Yeah, just note that the noun after the preposition is called the object of preposition, which means that the objective form (as opposed to the subjective form) is used. So in this case, where “to” is used as a preposition (instead of an infinitive), the objective form “whomever” is used.</p>