My name is***** and I will be helping you with your question today. This is for informational purposes only and does not establish an attorney client relationship.
Basically if your friend lived in this home 2 out of the past 5 years, he still might qualify. There is also a main home test (the home where he spent the most time). See below for the IRS requirements.
From the IRS website: https://www.irs.gov/publications/p523/ar02.html#en_US_2015_publink10008937
You can exclude up to $250,000 of gain ($500,000 if married filing jointly) on the sale of your home if you meet the Eligibility test.
Eligibility Step 1—Automatic Disqualification
Determine whether any of the automatic disqualifications apply. Your home sale is not eligible for the exclusion if ANY of the following are true:
You acquired the property through a like-kind exchange (1031 exchange), during the past 5 years. See Pub. 544, Sales and Other Dispositions of Assets.
You are subject to expatriate tax. For more information about expatriate tax, see chapter 4 of Pub. 519, U.S. Tax Guide for Aliens.
If any of these are true, skip to Figuring Gain or Loss , later.
Eligibility Step 2—Ownership
Determine whether you meet the ownership requirement. If you owned the home for at least 24 months (2 years) during the last 5 years leading up to the date of sale (date of the closing), you meet the ownership requirement.
If you received Form 1099-S, Proceeds From Real Estate Transactions, the date of sale appears in box 1 of Form 1099-S.
If you did not receive Form 1099-S, the date of sale is either the date the title transferred or the date the economic burdens and benefits of ownership shifted to the buyer, whichever date is earlier. (In most cases, these dates are the same.)
Eligibility Step 3—Residence
Determine whether you meet the residence requirement. If your home was your residence for at least 24 of the months you owned the home during the 5 years leading up to the date of sale, you meet the residence requirement. The 24 months of residence can fall anywhere within the 5-year period. It doesn't even have to be a single block of time. All you need is a total of 24 months (730 days) of residence during the 5-year period.
If you were ever away from home, you need to determine whether that counts as time living at home or not. A vacation or other short absence counts as time you lived at home (even if you rented out your home while you were gone).
If you have a disability, and are physically or mentally unable to care for yourself, you only need to show that your home was your residence for at least 12 months out of the 5 years leading up to the date of sale. In addition, any time you spend living in a care facility (such as a nursing home) counts toward your residence requirement, so long as the facility has a license from a state or other political entity to care for people with your condition.
Please let me know if you have any further questions and please positively rate my answer as it is the only way I will be compensated for my time by the site.