If Person A legal gave/sold Person B part of the property, then Person A should have reported the disposition of part of the principal residence when it occurred. Then when both sold the house, they would each report the number of years they owned their portion of the home. Ex: Person A owned 50% of the house for 4 years, while Person B owned 50% of the house for 2 years.