Both foreigners residing in Germany and those who have already left the country have the right to a tax refund.