The main general rule is that you are taxed on where you are living unless there are extra considerations, including for example bilateral agreements of the countries involved.
Since this can get confusing and complex very quickly the two most common solutions for this problem I usually see are:
If the company has a subsidiary, a sister-company, or ...
... will my marriage be valid?
Different countries have different conditions for recognizing marriages concluded under foreign law. Generally they are recognized, though in some cases they might not be. For example, a country that does not allow first cousins to marry may or may not recognize a marriage between first cousins performed ...
In the case of Sweden, the agreement is that someone residing in Sweden but with income from Germany pays taxes in Sweden on that income, but the german taxes is deducted from the ones payable in Sweden.
The rule is that you don't need to pay taxes two times on the same income.
I suggest that you contact the Skattecenter in Köpenhavn.