"그가 중국에서 2년을 살았습니다."
In English, you can say either "He has lived in China for two years" (intransitive verb "live") or "He has spent two years in China" (transitive verb "spend"). 2년을 살다 is thus similar to "spend two years", both 살다 and "spend" (or "pass" or some other) functioning as a transitive verb. It is just looking at the fact slightly differently - it doesn't have to be an intransitive verb. Another example would be "working along/down the street" (길(을) 따라 걷다) and "walking the street" (길을 걷다) - you can use the same verb, "walk" and 걷다, either intransitively or transitively.
그는 vs 그가
은/는 the topic marker 1) suits the default, normal way of your mind looking at the world (i.e. you have internalized it), 2) contrasts the noun with other (implied or mentioned) case.
이/가 the subject marker 1) suits a specific, external "happenings" in the world (you weren't necessarily thinking about it in your mind), 2) when the noun is needed by the context (because someone asked you, or it is needed in a sub-clause providing facts for the main point).
So 그는 중국에서 2년을 살았습니다 is the more common and proper way to talk about this particular fact, since it is something you know as a solid fact.
그가 중국에서 2년을 살았습니다 is not used as much, but it can be said if someone asked "Who has lived in China for two years?", for example. In this case, it is an anecdotal fact required by the particular situation of someone asking you, not from your own desire to express it, so you use 가.