Here's an authority on the subject:
"How long can I stay? When can I come back?
Please note that you will not find this guide anywhere in the IRS code. They are notoriously vague with their terms. As a result, we have striven to develop a few concrete suggestions for travelers. They are based on court cases (by citing records) and audits (personal experience). If you follow the guidelines below, you will be in a more defend-able position if audited. The things you need to look at is 3-fold.
1- Spend AROUND 30 days a year at home. - Not a magic number, it's just a goal. The main point being: 14 days a year is NOT enough! (And do not forget, you still need to be maintaining for some sort of residence there!)
2- Do not stay in any one area more than 12 out of 24 months. - This does not use a calendar year but 2 year look back. Also, 'one area' includes all places within a regional commuting / metro area. (that means surrounding towns also). Switching facilities or companies does not reset the clock! In determining how far is far enough to restart the clock, I usually ask if it is common for people who live in Town A to commute daily to Town B and work? If the answer is 'yes" then those two towns are too close and considered the same tax area.
3- Do not return to any one area a third year in a row. - You then create a pattern, and once you have a pattern, you have a tax home there, because it has become a primary/persistent place of income."
Located at: TravelTax Traveler Page