It is because two years is a duration.The way it is phrased is the natural way to say it. Why do you think it should be "had lived"?
Native speakers use the past perfect far less frequently than some teaching materials suggest they should. If the sequence of past=time events is clear, we often stick with the past simple.Why didn’t the writer use “had lived”?
Is this ok?:
I worked FOR company A for two years. I'm now working FOR company B.
If you have a question about the English language and would like to ask one of our many English teachers and language experts, please click the button below to let us know: