<prompt> Human: I live in Los Angeles and purchased a home but for the first 6 months, I lived with my girlfriend in her apartment while we got work done to the house. If I plan on selling the house in 2 years, would I still have to pay capital gains tax if I actually only lived there 1.5 years? The apartment and everything was under my girlfriends name.  <response>: No. Needs to be 2 years as a primary residence. 