This question already has an answer here:
I'm selling my home just one year after purchasing it (to move into a home with my husband). I might make as much as $6,000 profit. I intend to use this money for improvements on the new home. Will that be considered rolling over to a new home, thereby allowing me to avoid capital gains tax, or is the tax unavoidable?