The second inhabitant can be trusted.
Here’s my explanation:
The first one cannot be telling the truth. If all three are liars, then it means he is also a liar. Then he would be telling the “truth” saying that statement. The sentence contradicts itself.
We don’t know if second one is telling the truth yet, we go on and look at the statement made by the third person.
He first disagrees that only two people are lying. Then he makes the statement the other two guys are lying. If he is a person who always tells the truth, then this sentence contradicts itself. Therefore he must be lying.
Since not all three are liars, (by taking the opposite of what the first person says), and we know that the first and third persons are lying, the second one must be telling the truth.
Now we look at his statement again: “only two of us are liars,” he is, indeed, telling the truth.