The question of charging and collecting EU VAT comes down to two factors:
Where your customer is located
Whether the transaction is B2B or B2C
If you’re a European business, you always charge VAT in your home country. Nothing else matters. You charge VAT on every sale of digital goods.
But when selling elsewhere in the EU, there are differences in B2B and B2C.
In B2B you don’t need to charge VAT; there is a reverse-charge method wherein the buyer pays VAT to their own government. This saves you trouble, as you don’t have to file a separate tax return in each country where you make a sale. You just need to receive a valid VAT number from the buyer.
In B2C you charge VAT to all customers. But the rate of VAT you charge depends on how much you’re selling within the EU. If your business stays below €10,000 in cross-border sales of digital goods per year, throughout the EU, then you can charge the VAT rate of your home country on all those cross-border sales. Once you pass the €10,000 annual sales threshold, you must charge the VAT rate of your customer’s country.
For non-European businesses, simple rules apply. In B2B you should reverse-charge VAT. In B2C transactions, always charge the VAT of the customer’s country.