Deductions & credits

Thanks for replying. 

let me rephrase. If I sell my home tomorrow for 850,000 that I bought originally for 175,000 8 years ago. I netted after commissions, property taxes etc  something like a 580,000 gain. My wife and I are currently looking in a new city and it could be months before we find and close on a new place that will likely be more expensive than what we sold our house for. Does the IRS give you unlimited time to reinvest?