So sorry to be the messenger here, but when you rent all (or a part) of the house, that makes part of the time what what's called "disqualified use."
To get a full exclusion of ALL capital gain (up the the 250,000/500,000 limit) the house must be used EXCLUSIVELY as a primary residence.
YOu can read more about that here, in an article by ***** *****, Enrolled Agent.
"Taxpayers can qualify to exclude up to $250,000 in capital gains ($500,000 if married and filing
jointly) when selling a house. To qualify, the person needs to own and live in the property
has his or her primary residence for at least two years out of the five years ending on the date of sale.
Sometimes, however, the property isn't used as a primary residence during the entire five-year period. The house might be rented out, used as a vacation home, or used as a second home. Such uses of the home will be considered non-qualifying use and could subject gains from the sale of the house to tax.
Qualifying use means the property is being used by the homeowner or the homeowner's spouse as a primary residence. Non-qualifying use means the property is not being used as a primary residence by either the homeowner or the homeowner's spouse.
Homeowners who have used the property exclusively as their primary residence (that is, no second homes or rental use) will not need to allocate their gain."
Hope this helps to clarify.
Please let me know if you have ANY questions at all...
(I hope you'll rate
me positively, using the stars on your screen … (that's the only way we get credit
for the work here) … based on thoroughness and accuracy, rather than any good news/bad news content )