Deductions & credits

Improvements add to your cost basis, which helps reduce the capital gains (which might or might not be taxable).

 

The key factor for the partial exclusion is that you have to sell and move because of some event that makes it a hardship to stay in the prior home for the whole two years.  The hardship can be financial or something else.   There are several safe harbors -- situations which automatically qualify for a partial exclusion.  And there is a general allowance for "other facts and circumstances."  Birth of twins (or more) is a safe harbor (because you might not have enough space in your house for unexpected twins or triplets).  Birth of a single child is not a safe harbor.   You would have to be prepared to show the IRS that the home became unsuitable, either from financial or other reasons, because of the birth of the child, and this difficulty was not predictable at the time you bought the house.  The rules are here,

https://www.irs.gov/pub/irs-pdf/p523.pdf

 

You don't send proof with your tax return, but keep documents showing the circumstances in case you are audited.

 

No one on this board can know enough details about your personal and financial life to understand whether or not the birth of one child was both unpredictable and created such a hardship that you had to move without waiting the full two years.