A descriptivist view, or what actually happens
The most common current patterns of usage for "who" and "whom" in most "standard" English speech have diverged from the traditional grammatical distinction between "who"=subject and "whom" = direct and indirect object, described in various other writeups here. In practice, in any but the most formal sorts of speech and very frequently in writing, the situation for both the interrogative and the relative personal pronouns is that:
- "who" is universally used in subject/nominative roles ("Who ate all the pies?") as an interrogative pronoun, and almost universally - except for occasional instances of hypercorrection - when it is a relative pronoun ("I met a man who ate all the pies.") regardless of register.
- "whom" is generally used for an indirect object where it follows a preposition ("By whom were all the pies eaten?", "I met a man by whom all the pies were eaten") BUT this structure is marked as having a relatively high register, particularly where it appears at the beginning of the sentence or clause. Using "who" here will sound weird/wrong to most standard English speakers, as there is seems to be clash of register.
- The preposition that governs an object pronoun in such a case can alternatively be moved to the end of the clause, in which case "who" is almost always used ("Who were all the pies eaten by?", "I met the man who all the pies were eaten by"). This structure may be considered "incorrect" by people who follow a prescriptivist tradition, but is absolutely unremarkable in speech. Although it would in theory preserve the subject/object distinction, the use of "whom" in this structure is very rare, possibly because most people who might otherwise use it are also swayed by the Latin-influenced prescriptivist "rule" against using a preposition at the end of a sentence, and hence prefer the more awkward form described in point 2. People who are learning English as a foreign language or otherwise being tested on their English might want to be wary of using this form in examination conditions in case they meet prescriptivist examiners, but it is however the most "natural" sounding structure in real life native English speech.
- Similarly, when a direct object pronoun appears at the beginning of an interrogative clause, "whom" is considered correct by prescriptivists but "who" is almost always used in speech ("Whom did you meet?" versus "Who did you meet?") and quite frequently in writing. The use of whom is probably more common as a relative pronoun ("This is the man whom I met") than in questions. For learners, the same caveats as point 3 apply. Note that even people who use the "for whom" indirect object structure are quite likely to use "who" in a sentence-inital direct object position (cf. the Mojave 3 album Out of Tune which includes tracks called "Who do you love?" and "To whom should I write?")
When who/whom is used as a relative pronoun, interactions with phrasal verbs seem to be problematic. "This is the child whom I brought up" is a trifle awkward; *"This is the child up whom I brought" is wrong (phrasal verbs just don't do that). "This is the child who I brought up" would again be the most natural sounding form, but if you are scared of pedantic teachers/examiners/downvoters or the Microsoft Word grammar checker, you are probably best off using "that" or "which" instead (although that opens up a whole new kettle of fish).
The derived form "whomever" (although possibly not the legalese "whomsoever") seems to be more of an endangered species than "whom" tout court; "whoever" is more likely to be heard in its place even from ardent whom-ers.
As there seems little scope for ambiguity resulting from the use of
"who" in these cases - after all, nouns and the relative pronouns "which" and "that" work perfectly well in English without inflected forms for subject and object - it suggests that the need to distinguish subject and object
via different forms is not particularly strong, and may be likely to
fade away further in the future.
Although these points all suggest that "whom" is used more and more rarely, it should also be noted that hypercorrect use is quite common by speakers/writers who are seeking to raise their register and are aware of the prescriptivist rules but do not actually know them, particularly the use of "whom" for a relative pronoun which is the subject of the subordinate clause (?"I met a man whom ate all the pies"). I'm a descriptivist so I can't tell you not to do that, but don't do it anyway.
For reference, the author talks and works in a mostly southernish sort of British English, which probably colours the above writeup, but is not wholly unfamilar with a wide range of other local and distant variants both "standard" and otherwise. He accepts no responsibility for dropped marks, downvotes or black eyes you may receive as a result of following this advice, but would be interested to hear about them all the same.