You can wait to sell it, but no more than 4 years after moving out or within 5 years of moving in to the old residence. Because you did not live in the house, the require 2 years, your maximum exclusion is reduced.
Job
relocation is an exception to the 2 year rule. Your new job location must be at
least 50 miles farther from the sold home than the old job location. You are
entitled to a prorated amount of the $250,000 ($500,000 married) exclusion.
Example : if you lived in the old home 438 days (within the 5 years before you sold it) you could exclude up to 60%
{438/(365x2)} of the maximum amount or $150,000. Note that that your max exclusion will be reduced if you delay selling past the 4 year mark.
You will pay tax on the "depreciation recapture" portion of the gain for when it was rented out.
Incidentally, the job exception opens a loop hole for you. Ordinarily, you have to sell within three years of moving out to get the tax break. But because of the job change you can wait the 4 years you plan to.