Get the truth from a lie
A: One of the four people killed him. The doctor was dead when I left.
I'm not the second person to go to the doctor's house. He was still alive when I arrived.
C: I'm not the third person to go to the doctor's house. The doctor was dead when I left.
D: The murderer didn't leave until I went to the doctor's house. The doctor was still alive when I arrived.
Suppose we only treat it as a math problem, then D is not the murderer who makes D's words stand.
At that time, B and D will live, while A and C will die.
The first and second are BD, and the third and fourth are AC.
B says it's not the second one, so B is one and D is two.
C says it's not the third, so A is three and C is four.
D is not the murderer, the doctor was still alive when D went to see a doctor, and the doctor was dead when A left, so the murderer is A.
This can only be considered as a math problem.