So you hire two local directors, as contractors, from country B. On the contract signed, they oversee the day to day operations and work for you as advisor since you're the only shareholder. So their existence, the contract and the structure show that the company is managed in country B, run in country B and has economic substance in country B.
This way the offshore company isn't taxed in country A. This allows you to get dividends from the company tax free (after paying corporate taxes in country B) to your account in country A.
A few thoughts on this specific example.
If you truly are nothing but a passive source of funding for a company, then owning shares in this company is no different from owning shares in a public held company (e.g. BMW). The notion that dividends from the company are tax free in county A in that situation is very likely incorrect. Usually, dividends and other intangible income is taxable income in the country where they are received. Most likely, the dividends are income subject to taxation in country A.
There is a concept in tax law which U.S. tax lawyers call the "Economic Substance Rule" which is also true, but with different names (most of these countries don't have English language tax terminology anyway) which means that when someone is going through the motions of conducting a transaction in a tax favored form when in substance, something different is really going on, the tax authorities can choose to tax the substance rather than the form of the transaction. So, if the really valuable work is being done by the shareholder without visible compensation, rather than by the local directors and managers, you the shareholder might be taxed on "imputed income" representing the fair market value of the services rendered, or treated as the true manager of the company in country B. Similar issues can arise when valuable intellectual property is transferred to the company without being duly reflected in a fair market value purchase of equity interests, a sale at fair market value, or a licensing agreement for royalty payments.
Tax officials aren't limited to looking at paperwork. They can and do interview the human beings involved in interviews that those human beings are legally obligated to attend and cooperate with and to provide truthful information in with legal consequences for lying in those interviews.
Even if no official documentation or public statements would tip off tax officials, a significant share of tax evasion cases are driven by whistleblowing by disgruntled former employees, ex-spouses, jilted significant others, mistreated business partners, and revengeful angry children who feel that they have been mistreated by their parents. Nothing in the GDPR prevents whistleblowing to tax authorities.
Background