Luckily, figuring out whether to use who or whom is relatively simple.
Who or Whom?
When considering whether to use who or whom, you need to know if you need a subject or object pronoun. I know this can be tricky. After all, the terms in we're discussing appear in questions or inverted sentences and dependent clauses. So telling you to use who when referring to the subject of a sentence and whom for the object may help, but it still may be confusing. That's fine, because there's a quick way to figure it out.
The easiest way to decide whether you need who or whom is to substitute who/whom for another pronoun, like he/him (or she/her). So let's try this with the following sentences:
[Who/Whom] walked through the door?
He tried to find the woman [who/whom] owned the house.
Now, you wouldn't reconstruct the first sentence as “Him walked through the door,” would you? With the second sentence, you'll want to isolate the dependent clause. That will clarify: : “[she/her] owned the house.” So the sentences should read:
Who walked through the door?
He tried to find the woman who owned the house.
The examples above illustrated when to use who. But what about whom? Let's look at another example:
[Who/whom] did you have lunch with?
This one's a bit trickier, but taking a moment to rewrite it as a declarative sentence will help:
You had lunch with [he/him].
Does that help? So the original question should read:
Whom did you have lunch with?
Remember the M
I initially recommended to replace who/whom with he/him for a few reasons. First, it makes deciding whether you need a subject or an object easier. Also, simplistic as this sounds, the m in him should be an easy reminder to use whom. If you don't have an m, use who.