The first one I remember clearly was a software contractor — I'll call him Daniel. He'd moved to Lisbon, closed his US apartment, told his friends he was "out." He filed a final-looking return, mentally shut the door on the IRS, and got on with his life. Eighteen months later he got a notice saying he was a US tax resident for a year he was certain he'd spent mostly in Portugal. He read it three times. He thought it was a mistake.
It wasn't. It was an IRS substantial presence test surprise — the most common one I saw, and the one I want to spare you. Because here's the thing nobody tells you when you leave: residency isn't something you announce. It's something the IRS calculates. And the formula it uses does not care what you told your friends.
I spent eight years at the IRS in DC before I quit to live out of a carry-on. I knew the rules cold. I still watched smart, careful people get caught by the same trap, over and over, because the rule is counterintuitive in a way that punishes exactly the people who think they've been careful.
Leaving Is a Number, Not a Decision
Here's the mental model almost everyone has, and it's wrong: "If I spend fewer than 183 days in the US this year, I'm not a resident." People build entire travel calendars around that number. They count to 180, congratulate themselves, and book the flight home.
The Substantial Presence Test (SPT) is not a 183-day rule. It's a weighted, three-year formula. It counts every day you were in the US this year at full value, plus a third of your days from last year, plus a sixth of your days from the year before that. Add those up. If the total hits 183 — and you were in the US at least 31 days this year — you're a US tax resident, regardless of what you intended.
So you can spend well under 183 days in the US this year and still be a resident, because the previous two years are quietly riding along in the math. That's the surprise. The year you think you "left" is often dragged across the line by the years before it, when you were still spending real time stateside.
The Math That Caught Daniel
Daniel's numbers looked safe to him. Here's what they actually were:
- Current year (the "I basically left" year): 130 days × 1 = 130.0
- Prior year: 150 days × 1/3 = 50.0
- Two years prior: 180 days × 1/6 = 30.0
- Total: 210 days
He was 27 days over the threshold and didn't know it, because in his head the only number that mattered was the 130 he spent this year. He'd been a heavy US presence the two years before he left — long visits, a contract that kept pulling him back — and that history was still on the books. The formula amplifies exactly that pattern: someone who is winding down their US life, not someone who left cleanly years ago.
This is why I tell people the dangerous year isn't your first year fully abroad. It's the transition year, when your rear-view mirror is still full of US days.
"But I Was Barely There" Doesn't Help
The second thing that blindsides people is what counts as a day. The IRS counts any day you set foot in the United States, for any amount of time. Your arrival day counts. Your departure day counts. A weekend in New York for a wedding is two, three, four days on the ledger even though you'd never describe it as "living there."
There's exactly one narrow break: if you're in the US fewer than 24 hours purely in transit between two foreign countries, that layover doesn't count. That's it. The long weekends, the "I just flew in to see my mom," the conference in Vegas — all of it counts at full value. People reconstruct their year from memory, forget three or four short trips, and come up clean on a count that the IRS, working from airline and border records, scores as over the line.
I cannot stress this enough: the IRS often knows your travel history better than you do. Carrier records and entry data don't forget the trips you did.
The Lifeline You Probably Didn't File
Here's the part that still makes me wince, because it's so avoidable. Even if you meet the SPT, you may not actually be a resident — there's the Closer Connection Exception. If you were in the US fewer than 183 days this year, kept a tax home in another country all year, and genuinely have a closer connection to that country (your home, your family, your bank, your life), you can be treated as a non-resident.
But — and this is the whole ballgame — you have to claim it by filing Form 8840. It is not automatic. Daniel qualified for the Closer Connection Exception on the facts. His life was unambiguously in Lisbon. He just never filed the form, because he never knew he'd tripped the test in the first place. You can't claim an exception to a rule you don't know you broke.
If your country has a US tax treaty, there's a second door — treaty tiebreaker provisions filed with a 1040-NR — but that, too, requires you to know you're in the conversation and to file the right disclosure. Silence is not a strategy. Silence is how you become a resident by default.
What I Tell People Now
After watching this play out enough times, my advice comes down to three things, and none of them happen at tax time.
Track all three years, continuously. Your SPT status is a live number, not a year-end calculation. Before you book a trip home, you should know what it does to your weighted total — including the fractional days still bleeding in from two years ago. Decisions made at booking time are free. Decisions made after a notice arrives are expensive.
Count days you'd never think to count. The arrival day, the departure day, the 30-hour visit. If your foot touched US soil, log it. Assume the IRS already has.
Keep the evidence as you go. Boarding passes, entry stamps, hotel records. If your residency is ever questioned, a count you can document is the only count that protects you. Reconstructing two years of travel from memory the week a notice lands is how qualified people end up paying anyway.
Daniel's story ended fine, by the way — he had the facts, filed late, and untangled it. But it cost him months of stress and a chunk of money he should never have spent. The whole thing was preventable with one number he could have watched all along.
That's the number ResidencyProof keeps in front of you. It runs the real weighted three-year substantial presence formula against your actual location history, flags the trips you'd otherwise forget, and warns you before you cross the line — not after the IRS does the math for you. It's a tracking tool, not tax advice, but it gives you the one thing every blindsided expat wishes they'd had: a count you can trust and prove. Start your free 7-day trial at ResidencyProof and find out where you actually stand before the IRS tells you.