To determine whether you are traveling away from home, you must first determine the location of your tax home.
Per IRS Publication 463 Travel, Gift, and Car Expenses, on page 3:
To determine whether you are traveling away from home, you must first determine the location of your tax home.
Generally, your tax home is your regular place of business or post of duty, regardless of where you maintain your family home. It includes the entire city or general area in which your business or work is located.
If you have more than one regular place of business, your tax home is your main place of business. See Main place of business or work, later.
If you don’t have a regular or a main place of business because of the nature of your work, then your tax home may be the place where you regularly live. See No main place of business or work, later.
If you don’t have a regular or main place of business or post of duty and there is no place where you regularly live, you are considered an itinerant (a transient) and your tax home is wherever you work. As an itinerant, you can’t claim a travel expense deduction because you are never considered to be traveling away from home.
If you have more than one place of work, consider the following when determining which one is your main place of business or work.
You may have a tax home even if you don’t have a regular or main place of work. Your tax home may be the home where you regularly live.
If you don’t have a regular or main place of business or work, use the following three factors to determine where your tax home is.
If you satisfy all three factors, your tax home is the home where you regularly live. If you satisfy only two factors, you may have a tax home depending on all the facts and circumstances. If you satisfy only one factor, you are an itinerant; your tax home is wherever you work and you can’t deduct travel expenses.
If you (and your family) don’t live at your tax home (defined earlier), you can’t deduct the cost of traveling between your tax home and your family home. You also can’t deduct the cost of meals and lodging while at your tax home. See Example 1, later.
If you are working temporarily in the same city where you and your family live, you may be considered as traveling away from home. See Example 2, later.
See the examples in the publication for details.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the document at the time it is accessed.