Selling a company in the next two years?

Published by Carlota Pastora Business Law Firm11 min read
Selling a company in the next two years?

You own a company in Spain. A buyer approaches you, and the sale of the company is expected to take place within two years. A friend tells you that if you move to Andorra before the sale, you would pay almost no tax. Is the friend right? Who gets to tax the sale?

Spain, like several other countries, applies what is commonly known as an exit tax. In certain circumstances, simply ceasing to be resident in Spain is treated as if the shares had been sold, and the increase in their value is taxed on departure, before any sale has actually taken place. For a business owner planning a move ahead of a sale, this can mean paying tax sooner, not later. This article deals with a sale of shares by an individual shareholder; a sale of business assets by the company itself has different tax consequences.

Who has the right to tax the sale?

When an individual sells company shares, the capital gain may be of interest to both the country where the seller lives and the country where the company is based. To avoid double taxation, countries sign double tax treaties. Many treaties provide that a gain on the sale of shares is taxable only in the country where the seller is resident at the time of sale, but there are important exceptions. Under the Spain-Andorra treaty, for instance, if, at any time during the 365 days before the sale, more than 50% of the value of the shares derived, directly or indirectly, from real estate located in the other State, that State may also tax the gain (Article 13(4), as modified by Article 9(1) of the Multilateral Instrument, with effect from 2023), unless the shares are listed on a recognized stock exchange in either State. The same treaty also allows Spain to tax gains on shares representing, directly or indirectly, at least 25% of the capital of a Spanish-resident company (Article 13(5)). A further rule allows Spain to tax gains on shares that entitle the holder to enjoy real estate in Spain (Article 13(6)). Where any of these rules applies, Spain may tax the gain on the sale at the 19% non-resident rate, including any increase in value after the move, even if the seller is by then resident in Andorra. Where Andorra also taxes the gain under its own rules, it must credit the Spanish tax, up to the Andorran tax on that gain. The treaty does not split the gain between the periods before and after the move. Where none of these rules applies, the gain is in principle taxable only in Andorra (Article 13(7)), but leaving Spain may itself trigger the Spanish exit tax described below. Moreover, under paragraph I(5) of the treaty’s Protocol, Spain may tax a gain that the treaty reserves to Andorra if it is not subject to tax there; whether this covers a gain exempt under Andorran law is a matter of interpretation that must be assessed case by case. If that exit tax has been charged, Spain takes the market value used for it as the acquisition cost when taxing the later sale (Article 24(4) of the Non-Resident Income Tax Law), so it does not tax the same gain twice. Andorra, however, has no express rule giving a higher base cost on arrival, and it is unclear whether it would credit a Spanish exit tax; unless its exemption applies, the gain already taxed on departure may be taxed again there. The treaty also preserves each State’s anti-abuse rules and denies its benefits where obtaining them was one of the principal purposes of an arrangement, which is relevant to a move timed to a sale.

Exit tax: leaving is treated as selling

Several countries around the globe tax departing shareholders through an exit tax, with significant differences in thresholds and the relief available. An exit tax is applied to unrealized gains – increases in value that have not yet been realized through a sale – when someone stops being a tax resident in a country. It is an anti-avoidance measure designed to stop taxpayers from escaping tax on gains accrued while resident by changing their tax residence.

Exit taxes apply to both individuals and companies, but under different rules. For companies, Article 5 of Council Directive (EU) 2016/1164 has, since January 1, 2020, required EU member states to tax unrealized gains when a company moves assets between its head office and a permanent establishment in another country, or from a permanent establishment to another one abroad, or transfers its tax residence or the business of a permanent establishment abroad, and the State of departure thereby loses its right to tax the assets. Where the transfer is to another EU state, or to an EEA state with a tax-recovery assistance agreement, the company may pay in installments over five years, although interest may be charged and, where there is a demonstrable and actual risk of non-recovery, a guarantee required. This corporate charge arises only on transfers made by the company itself. When a shareholder relocates, or sells their shares, the relevant tax is their own. Individual exit taxes are set by each country's national law, and differ in how they are applied. The table below summarizes the main rules in selected countries:

CountryWho is affectedMain features
Spain (Art. 95 bis LIRPF)Individuals who were Spanish income-tax residents for at least 10 of the 15 tax periods preceding the last one in which they must file in Spain. They must hold shares or fund units worth more than €4 million in total, or more than 25% of a company where that stake is worth more than €1 million.Unrealized gains on shares and fund units are taxed as savings income (at up to 30%) in the last Spanish tax period, through a supplementary return filed in the return period for the first year of non-residence. For moves to another EU state, or to an EEA state with which there is an effective exchange of tax information, the taxpayer can opt to be taxed only if, within ten years, the shares are transferred inter vivos (including by gift), the taxpayer leaves the EU/EEA or reporting duties are breached. Otherwise the tax is due with that return. For a temporary move to a country whose tax treaty with Spain contains an exchange-of-information clause, such as Andorra, payment may be deferred for up to five years, normally against security and with interest; however, the deferral ends two months after any transfer of the shares, so it is of little help where a sale is planned. The debt lapses only if Spanish residence is regained within that period without the shares having been transferred.
AndorraAndorra has no exit tax on individuals. Individuals moving to Andorra remain exposed to their home country’s exit tax and, where the applicable treaty allows it, to tax in the country where the company is based. A later sale is taxed in Andorra at the general rate of 10%, unless exempt under Article 5(k) of Law 5/2014: holdings of no more than 25% of the capital, equity, profits or voting rights (counting related persons and relatives) in the previous 12 months, or larger holdings owned for at least ten years. Since 2024, the exemption does not apply where at least 50% of the company’s assets consist, directly or indirectly, of real estate located in Andorra. Special surcharges also apply to short-term gains on Andorran real estate, and may extend to shares treated as such.
Germany (§ 6 AStG) Individuals with unlimited German tax liability for at least 7 of the last 12 years who held, directly or indirectly, at least 1% of a German or foreign company at any time in the last five years. Since 2025, similar rules also apply to investment fund units (at least 1% of a fund or acquisition cost of at least €500,000; special investment funds without threshold). Shares are deemed sold at market value. For shares, 60% of the gain is taxed at the personal income tax rate. On application, the tax can be paid in seven interest-free annual installments, generally against security.
NetherlandsNo minimum residence period. Affected are individuals holding a "substantial interest," generally meaning at least 5% of the issued share capital (or of a class of shares) of a Dutch or foreign company, options to acquire such a stake, or profit rights of at least 5%, counting a partner's holdings. A protective assessment (conserverende aanslag) is issued on the deemed gain, taxed in Box 2. Payment is deferred without time limit (automatically for EU/EEA moves; on request and usually against security for other destinations, such as Andorra), but the tax becomes due, in whole or in part, on a sale, a dividend or certain other events.
USAUS citizens who renounce citizenship and long-term green card holders (in at least 8 of the last 15 years) who give up residency, if they meet any of three tests: net worth of $2 million or more, average annual net income tax above $211,000 (2026) over the previous five years, or failure to certify tax compliance. Certain citizens who were dual nationals from birth, or who renounce citizenship before age 18½, are exempt from the first two tests if they meet specific residence conditions, but must still certify compliance.Most worldwide assets are deemed sold at fair market value the day before expatriation; the first $910,000 of gain (2026) is excluded. Deferred compensation, certain tax-deferred accounts and trust interests follow special rules.

Planning ahead

If you expect to sell your company’s shares, it is important to consider, before the sale agreement is signed, where you will be tax resident in the year of the sale and whether leaving would itself trigger an exit tax. Spain assesses residence for the whole calendar year: you are resident if you spend more than 183 days in Spain, if your main business or economic interests are in Spain or, unless proven otherwise, if your spouse (not legally separated) and your dependent minor children live there. Leaving mid-year may therefore leave you Spanish resident for that entire year. Sporadic absences count as days in Spain unless tax residence elsewhere is proven, and continuing to own and run a Spanish company may keep your main economic interests in Spain. If both countries treat you as resident, the treaty’s tie-breaker rules decide. Other points to consider include:

  • Whether there is a double tax treaty between the countries concerned;
  • The size of your shareholding, and whether the company’s value derives mainly from real estate, compared with the thresholds in any applicable treaty;
  • How many years you have been tax resident in the country you are leaving, and the value of your shareholding, for exit-tax purposes;
  • Whether a tax deferral is available, and
  • Consequences for succession planning, including Spanish wealth, gift and inheritance taxes, which the treaty does not cover and which may still apply to Spanish shares after the move.

Moving abroad before a sale can form part of a sensible plan, but it is seldom the shortcut it appears to be. Exit taxes, treaty provisions and the evidential requirements of residence interact in ways that depend on each family's circumstances.

How we can help

Effective wealth planning requires advisers who understand the family’s objectives and its position at home, working alongside practitioners in the jurisdictions where the assets are held. At Carlota Pastora Business Law Firm & Wealth Planning, we advise families on choosing, setting up and reviewing trusts, foundations and the vehicles that sit beneath them, so that each structure fits both their goals and their circumstances, and on the tax implications of cross-border moves and share sales.

Contact our team to discuss how a planned sale or move abroad would affect you and which structure best suits your family.

Takeaways

  • Moving abroad before a sale is rarely a shortcut. Consider whether an exit tax applies instead.
  • The destination changes the outcome. Spain’s most favourable exit-tax regime is designed for moves within the EU or EEA. Andorra is in neither; at most, a temporary deferral may be available, and it ends if the shares are sold. The applicable treaty must also be checked for its thresholds and rules.
  • Plan ahead, not after the sale has taken place.

FAQs

1. When should I start planning if I expect to sell?

As early as possible, and before any sale agreement is signed. The years of residence, the timing of the move, the structure of the deal and the effect on succession planning all need to be considered together, and some options are only available if decided in advance.

2. What is an exit tax?

An exit tax is a tax on gains that have built up but have not yet been realized, charged when someone stops being tax resident in a country. Leaving is treated as if certain assets had been sold, so the country can tax the increase in value that arose while the person lived there.

3. Why does it matter where I am resident when I sell?

Under most double tax treaties, gains on the sale of shares are taxed only in the country where the seller is resident at the time of sale. The timing of a move can therefore determine which country taxes the gain, and how much. There are exceptions: the Spain-Andorra treaty, for example, also allows the company’s country to tax gains on shares representing at least 25% of its capital, and the country where the real estate is located to tax shares in real-estate-rich companies or shares giving the right to enjoy that real estate.

4. Can I be tax resident in two countries at the same time?

Yes. Each country applies its own residence rules, so a person can meet the criteria of two countries in the same year. Where a double tax treaty exists, it usually contains tie-breaker rules to determine which country is treated as the country of residence for treaty purposes.

5. Do exit taxes apply only to shares?

Not always. Many exit taxes focus on shares and similar interests, but some countries also cover other assets, such as investment fund units, pension rights or business assets. The scope depends on the rules of the country being left.

This article is for general information only, and does not constitute legal or tax advice. Tax rules change frequently, and their application depends on individual circumstances. This article reflects the law as at November 2026.

Subscribe to our newsletter

Privacy Policy