Good article:
"Don’t start construction on preparing the house for your personal use right after acquiring it"
"The principal question is your intent when you acquired the replacement property. If you sincerely intended to treat it as investment property and not to move into it at the first opportunity, then you are on the right track. How can you prove that intent? If you can’t meet the safe harbor test discussed below, the best way is to actually use the property for investment purposes for a significant period of time after its acquisition. If you rent the house out at fair market value for at least a year (according to some commentators), then you likely have shown you acquired the property with investment intent. If you merely put up a good show, on the other hand, such as listing it for rent at an amount that is significantly higher than market, or not even listing it at all, the IRS will see right through that"
Sometimes it's amazing how hard it is protect clients from themselves.