To determine whether to use whoever or whomever, the they/them rule in the Who/Whom section applies:
they = whoever
them = whomever
Rule 1. The presence of whoever or whomever indicates a dependent clause. Use whoever or whomever to agree with the verb in that dependent clause, regardless of the rest of the sentence.
Examples:
Give it to whoever/whomever asks for it first.
They ask for it first. Therefore, whoever is correct.
We will hire whoever/whomever you recommend.
You recommend them. Therefore, whomever is correct.
We will hire whoever/whomever is most qualified.
They are most qualified. Therefore, whoever is correct.
Rule 2. When the entire whoever/whomever clause is the subject of the verb that follows the clause, analyze the clause to determine whether to use whoever or whomever.
Examples:
Whoever is elected will serve a four-year term.
Whoever is the subject of is elected. The clause whoever is elected is the subject of will serve.
Whomever you elect will serve a four-year term.
Whomever is the object of elect. Whomever you elect is the subject of will serve.
A word to the wise: Whomever is even more of a vogue word than whom. Many use it indiscriminately to sound cultured, figuring that no one will know any better.