The easiest way to understand this problem is to make an in situ question. For an in situ question we don't move the wh- word to the front of the sentence. We leave it in the same place it would be in a normal sentence:
- You gave it to who?
- You did what?
- You went there when?
- You did it how?
- Who ate it?
In these in situ questions we do not need any subject auxiliary inversion. Notice also that the question words there are in the same position in those sentences as they will be in the answers:
- I gave it to Bob.
- I did this.
- I went there yesterday.
- I did it like this.
- Bob ate it.
Now if we make a normal question notice that the wh- word moves to the front of the sentence and we need subject auxiliary inversion:
- Who did you gave it to?
- What did you do?
- When did you go there?
- How did you do it?
I only did the first four questions above. Notice that in the fifth example, the in situ question was:
and the answer was:
Now in this in situ question, the wh- word is already at the front of the sentence, because the thing/person we are asking about is the subject of the verb ate. Because we do not need to move the wh- word, we do not need to use subject auxiliary inversion here. The normal question and the in situ question are the same.
It does not matter if the wh- word is who or what or which or whose. If the wh- word does not need to move because it is already at the front of the sentence, then we do not need subject auxilairy inversion.
- Who ate it?
- What happened?
- Which person said that?
- Whose girlfriend kissed you?
We can see that these words were already at the front of the sentence when we see the answers:
- Bob ate it.
- This happened.
- That person said it.
- Bob's girlfriend kissed me.
The Original Poster's question
Who lives there?
In this sentence, the word who is the subject of lives. We do not need to move it to the front to make the question. Notice that in the answer, the name of the person comes in the same place as the wh- word:
Because the question word is already at the front of the sentence, we do not need subject auxiliary inversion.
Hope this is helpful!