If a firm operates abroad, the host and the residence country have to decide how to divide the taxing rights among them. Firstly, the host country has to determine whether or not the firm has to file for income taxation at source. Secondly, the income has to be split between the two jurisdictions for tax purposes. These two decisions determine the extent of source- and residence-based taxation. We build a two-country model with costs of tax administration and compliance in order to analyze these two decision margins. We show that the globally optimal solution may imply a mix of source-based and residence-based taxation. Decentralized policies may attain the global optimum if specific transfer pricing rules are applied.