How Germany taxes you when you leave
Unlimited tax liability: home or habitual abode
You are fully taxable in Germany on your worldwide income if you have a Wohnsitz there, meaning a home you keep and can use, even if you are rarely there, or your gewöhnlicher Aufenthalt, which generally means more than six months in Germany. The Abmeldung at the Bürgeramt is a necessary step but not the deciding one. A furnished flat kept "just in case" is a classic way to stay German tax resident.
Exit tax on company shares (§6 AStG)
If you hold at least 1% of a corporation, German GmbH or foreign company, and were fully taxable in Germany for at least seven of the last twelve years, leaving counts as selling those shares at market value. The tax is due on departure; on application it can be paid in seven annual instalments, usually against security. If you come back within seven years (extendable to twelve), it can be cancelled.
Extended limited tax liability (§2 AStG)
German citizens who were fully taxable for at least five of the last ten years, move to a low-tax country and keep substantial economic interests in Germany, such as a significant stake in a German business, can remain taxable on a wider range of German income for the year of departure and the following ten years.
CFC rules and place of management
While you are German tax resident, Germany's CFC rules (Hinzurechnungsbesteuerung) can add passive income of a foreign company you control to your income if it is taxed below 15%. Separately, a Dubai company that is actually managed from Germany is taxable in Germany. Both are reasons why a Dubai company works only after a real move.