The easy way to decide
The easiest way to deduce which of the words you should use is to decide whether you could substitute he, she or they for the word in either your sentence or a similar sentence. If you could insert these words, use who. On the other hand, If you would have to substitute him, her or them for your word, use whom.
I haven’t seen the lady who lives next door for at least a week.
In the above sentence, the lady is the subject of the sentence and you could use the word she to refer to the lady. Who is, therefore, the right choice.
I have been thinking about with whom I might be playing chess next week.
With this sentence, it isn’t immediately obvious whether you should use who or whom. To work out which word to select, imagine the meaning of the sentence expressed in a different way. Would you say:
I have been thinking that I might be playing chess with him next week
I have been thinking that I might be playing chess with he next week.
Clearly, the first option is the correct one, hence whom is the right word to use in the original sentence.