The simple answer to this question is that you will pay inheritance taxes wherever your assets are located.
So for example if you live in Spain, own a property there and have no assets outside of Spain, the beneficiaries of your will shall be obliged to pay inheritance tax in Spain on their share of the value of the property that they inherit.