Beancount.io LogoBeancount.io

Section 7701(b) Substantial Presence Test for Foreign Entrepreneurs: The 183-Day Formula, Closer Connection, and Treaty Tie-Breakers

13 min readMike ThriftMike Thrift
Section 7701(b) Substantial Presence Test for Foreign Entrepreneurs: The 183-Day Formula, Closer Connection, and Treaty Tie-Breakers

A foreign founder flies to San Francisco for a pitch meeting on January 8. She stays a week. She returns in February for two more weeks of investor diligence. Spring brings a six-week stretch at an accelerator. Summer adds a month of beach-house "work-from-anywhere" with the team. By Thanksgiving, she has spent 142 days in the United States — and she still considers herself a tax resident of her home country.

The IRS may disagree.

Internal Revenue Code Section 7701(b) contains a deceptively mechanical test that converts physical days on U.S. soil into worldwide income tax exposure. Cross its threshold, and the United States can tax your salary in Berlin, your dividends in Singapore, your crypto gains in Dubai, and your rental income in São Paulo — even if you never opened a bank account here. Most foreign business owners learn this the hard way, usually around April 15 of the following year, when a U.S. CPA delivers an unwelcome surprise.

This guide walks through the Substantial Presence Test as it actually applies to entrepreneurs, investors, and globally mobile professionals: the weighted day-count formula, which days don't count, how to use the closer connection exception, and when a treaty tie-breaker is your last line of defense.

What Section 7701(b) Actually Decides

Section 7701(b) determines whether a non-U.S. citizen is a "resident alien" for federal income tax purposes. The label sounds clerical. The consequences are anything but.

A nonresident alien generally pays U.S. tax only on U.S.-source income and on income effectively connected with a U.S. trade or business. A resident alien, in contrast, is taxed exactly like a U.S. citizen: on worldwide income, with reporting obligations for foreign bank accounts (FBAR/FinCEN 114), foreign financial assets (Form 8938), foreign corporations (Form 5471), foreign partnerships (Form 8865), foreign trusts (Form 3520), and a list of others that grows each year.

There are two paths to resident-alien status: holding a green card, or meeting the Substantial Presence Test. Most accidental residents fall in through the second door without realizing the door exists.

The 183-Day Weighted Formula

The Substantial Presence Test has two requirements that must both be satisfied for a given calendar year:

  1. Current-year minimum. You must be physically present in the United States at least 31 days during the current year.
  2. Three-year weighted total. Your weighted day count over a rolling three-year window must reach 183 days, calculated as:
    • 100% of days present in the current year
    • 1/3 of days present in the first preceding year
    • 1/6 of days present in the second preceding year

If you flunk the 31-day floor for the current year, the test does not apply that year regardless of your historical pattern. If you meet 31 days but fall short of 183 weighted days, you remain a nonresident under domestic law (a treaty may still apply).

Worked example

Suppose Ana, a Spanish founder, spends:

  • 2024: 150 days in the U.S.
  • 2025: 120 days
  • 2026: 130 days

For 2026:

  • 130 (current) + 120 × 1/3 + 150 × 1/6
  • = 130 + 40 + 25
  • = 195 weighted days

Ana crosses 183. She is a U.S. resident alien for 2026 unless she qualifies for the closer connection exception or a treaty tie-breaker. Her Spanish-source income, her share of the Spanish S.L. she founded, and her global investment portfolio are now within reach of the IRS for the entire calendar year.

The 121-day myth

Many entrepreneurs operate on the rough rule of thumb that "120 days a year is safe." It is — barely — if you spend roughly the same time every year. Three years of 121 days each adds up to 121 + 40.3 + 20.2 ≈ 181.5 weighted days, just under the line. But spike one year over 122 and the cumulative math turns against you the year after. Treat 120 as a soft ceiling, not a target.

Every 24-Hour Period Counts (Usually)

A "day" of presence is any day you are physically present in the United States for any part of the day. Landing at JFK at 11:55 p.m. counts as a full day. So does departing LAX at 12:05 a.m. The 24-hour fiction in many countries' tests does not apply here.

The regulations under Treas. Reg. §301.7701(b)-3 carve out narrow exceptions. The day does not count if:

  • You commute regularly from a residence in Canada or Mexico to work in the U.S. ("regular commuter" rule).
  • You are in transit between two foreign points and your time in the U.S. is less than 24 hours, and you do not attend a business meeting or engage in U.S. activities outside the airport.
  • You are a crew member on a foreign vessel engaged in international transportation.
  • You are unable to leave because of a medical condition that arose while you were in the U.S. (the condition must arise here — not before you arrived).
  • You qualify as an "exempt individual" for that day under one of the visa-based categories below.

Note what is not on this list: vacation days, sick days unrelated to a U.S.-arising condition, weather delays, work-from-laptop days, and days you spent on someone else's couch. They all count.

Exempt-Individual Status: Visa-Specific, Time-Limited

Certain visa categories let you exclude entire periods of presence — but each comes with a clock. Days as an exempt individual still happen, but they don't count toward the 183-day total.

  • Foreign government-related individuals on "A" or "G" visas (excluding A-3 and G-5 personal employees), and members of their immediate families.
  • Teachers and trainees on "J" or "Q" visas: exempt for any two calendar years out of the last six.
  • Students on "F," "J," "M," or "Q" visas: exempt for five calendar years (any part of a year counts as a full year), with possible extensions in narrow circumstances.
  • Professional athletes temporarily in the U.S. to compete in a charitable sports event.

Every exempt individual must file Form 8843 annually, even if they have no other U.S. filing requirement. Miss the form and the IRS can argue the days count.

A common founder trap: a student on an F-1 visa starts a company during OPT (Optional Practical Training), then transitions to an O-1 or E-2 visa in year six. Year six is the first year days count from January 1 forward — including January days that felt like a continuation of student life.

The Closer Connection Exception (Section 7701(b)(3)(B))

If you flunk the math, you may still escape resident-alien status under the closer connection exception. To qualify, all of the following must be true for the current year:

  1. You are present in the U.S. fewer than 183 days during the current year (a hard ceiling — 183 actual days disqualifies you, full stop, even if your weighted total over three years is exactly 183).
  2. You maintain a tax home in a single foreign country for the entire calendar year. A tax home is your regular or principal place of business — or, if you have no regular place of business, your regular place of abode.
  3. You have a closer connection to that foreign country than to the United States.

The closer connection analysis is a facts-and-circumstances inquiry. The IRS looks at where your permanent home is located, where your family lives, where your personal belongings and vehicles are kept, which country issued your driver's license, where you are registered to vote, where you maintain your professional, social, and religious affiliations, where your routine banking is done, the source of your income, where you signed leases or holds memberships, and the country listed as your residence on official documents and forms.

You claim the exception by timely filing Form 8840 (Closer Connection Exception Statement for Aliens). If you have a U.S. return to file (e.g., Form 1040-NR for U.S.-source income), attach Form 8840. If you don't, mail it standalone. The deadline aligns with the Form 1040-NR due date, generally June 15 of the following year. File late and you generally forfeit the exception — the IRS can refuse to consider it unless you show by clear and convincing evidence that you took reasonable steps to learn and comply.

Two structural limits worth memorizing: the exception is unavailable if you have applied for a green card, taken affirmative steps to obtain lawful permanent resident status, or have an application pending. And the exception does not stretch to dual closer connections — you must point to a single foreign country (the regulations allow a narrow two-country variation when a tax home shifts mid-year, but never simultaneous loyalty to two).

The Treaty Tie-Breaker: When Both Countries Claim You

The closer connection exception relies on U.S. domestic law. A treaty tie-breaker is a separate, often stronger tool — and the only path available if you are present 183+ actual days in the current year or are pursuing a green card.

If you are a "resident" under U.S. domestic rules (you met the Substantial Presence Test) and a "resident" under the domestic rules of a country that has an income tax treaty with the U.S., the treaty's Residence article resolves the conflict. Almost all modern U.S. treaties follow the OECD Model and apply the following tests sequentially — you stop at the first test that resolves residency:

  1. Permanent home. A residence available to you at all times. If only one country provides one, residency is assigned there.
  2. Center of vital interests. Where are your personal and economic ties strongest? Family location, business interests, banking, social affiliations, club memberships, philanthropy.
  3. Habitual abode. Where do you actually spend more of your time, looking beyond a single year if needed.
  4. Nationality. If the prior tests fail, citizenship breaks the tie.
  5. Mutual agreement between the two countries' competent authorities, in the rare case nationality still fails.

To claim a treaty tie-breaker position that overrides your U.S. residency, you generally file Form 1040-NR (not Form 1040) and attach Form 8833 (Treaty-Based Return Position Disclosure). Failing to file Form 8833 when required can trigger a $1,000 penalty per position for individuals ($10,000 for corporations), separate from any tax adjustment.

Three caveats:

  • A treaty tie-breaker affects federal income tax. It does not bind U.S. states. California, New York, and most other high-tax states do not honor treaty positions and may still tax you on residency or sourcing grounds.
  • A tie-breaker generally does not relieve you of information-reporting obligations on FBAR, Form 8938, Form 5471, Form 8865, and similar — the IRS has consistently taken the position that an individual treated as a resident under domestic law remains a "U.S. person" for these purposes regardless of treaty residence.
  • The country you "win" residency to under the tie-breaker must actually have a treaty with the U.S. Singapore, Brazil, Hong Kong, and the UAE do not — entrepreneurs from those jurisdictions get the closer connection exception or nothing.

First-Year and Dual-Status Wrinkles

Even if you meet the Substantial Presence Test, you may not be a resident for the entire year. Two situations create dual-status years:

Residency starting date. Your residency typically begins on the first day you are present in the U.S. during the year you meet the test (after meeting a de minimis 10-day exception for transient earlier days that maintain a closer connection to your tax home). Days before that date are nonresident days.

First-year election. A foreign individual who does not meet the Substantial Presence Test in the current year but expects to meet it next year can sometimes elect to be treated as a resident from a date in the current year, useful for couples electing joint filing.

Last-year residency termination. Residency ends on the last day of presence in the U.S. for the year you no longer meet the test, again with a 10-day closer connection cushion.

Dual-status returns are notoriously painful — you cannot use the standard deduction, you compute tax on a hybrid basis, and many credits are limited. Most foreign founders relocating to or from the U.S. underestimate the complexity until they hand a CPA their travel calendar.

Track Days Like You Track Cash

The single most important habit a globally mobile entrepreneur can build is daily tracking of U.S. presence — passport stamp by passport stamp, boarding pass by boarding pass. The IRS has obtained access to Department of Homeland Security entry/exit records through the CBP I-94 system. They know when you arrived. They know when you left. The only person who can be surprised is you.

Build a simple spreadsheet with columns for entry date, exit date, day count, year-to-date current year, year-to-date weighted total, and visa status on each day. Reconcile it against your boarding passes once a quarter. Keep it for at least six years — the IRS statute of limitations on a fraud or substantial-understatement case stretches that far.

Accurate bookkeeping connects directly to this. Every U.S. business expense, every domestic bank account you opened to run your accelerator stipend, every Stripe payout: the date stamps in your books are evidence of presence. Reconciling travel days to expense data after the fact is far easier than reconstructing it from memory in an audit.

Common Mistakes That Cost Founders Money

  • Counting nights, not days. Two overnight stays around a Friday business meeting can equal four days, not two.
  • Assuming Form 8843 is optional. Students and J/Q visa holders must file every year of exempt status, even with zero income.
  • Ignoring the 183-actual-day ceiling. Crossing 183 actual days in the current year disqualifies the closer connection exception even if you meet all other elements.
  • Mixing closer connection and treaty arguments on the same return. They are different positions filed on different forms. Pick the right one.
  • Forgetting state taxes. A treaty tie-breaker that wins federally can lose at the state level. California in particular is aggressive on residency.
  • Letting a green-card application kill the exception. The closer connection exception is forfeited once you apply for or hold a green card, even if the application is pending.
  • Forgetting global reporting. Even with a treaty tie-breaker, FBAR and Forms 8938/5471/8865 reporting obligations typically persist.
  • Treating short trips as throwaways. A two-day diligence visit in December is two days against the same 183-day budget as a two-week conference in March.

Keep Your Cross-Border Finances Organized From Day One

For a foreign business owner, the line between nonresident and resident is drawn with travel-day arithmetic and supporting financial records. The IRS will not accept "I think I was there about three months." A reliable, version-controlled ledger that ties expenses, receipts, and bank activity to specific dates is the strongest evidence an entrepreneur can produce in a residency dispute. Beancount.io provides plain-text accounting that is transparent, version-controlled, and AI-ready — exactly the audit trail you want when the question is whether you spent 182 days or 184 days in the United States. Get started for free and keep your global finances and your travel record reconcilable for years to come.