Get your taxes done using TurboTax

Obviously the IRS regulations (laws) are correct.  The requirement is that one must live in the home as one’s primary residence for two years (731 days) out of a 5 year period ending on the day of the sale.  The two years (731 days) do not have to be consecutive but must occur within 5 years of the sale date.  

There is an exception or extension for military and certain others who moved as a result of foreign service orders, but you have never mentioned that before.