US and Spain Taxes for US Expat

As I understand it, as a retired US person, Spain taxes my worldwide income (social security, pension and if I were to sell my house in the US, capital gains).
Is all of that tax written off against my US tax obligation so it essentially zeros out?
Have heard a variety of answers to that question - does someone have the definitive answer?
Gracias

John

May I  suggest you check out the double taxation agreement between Spain and USA

I found this which might help you to find the answers :-

https://www.irs.gov/pub/irs-trty/spain.pdf

Taxation can be quite complex and the rules interpreted differently even by the individuals working at the tax authorities. Generally if you are a small fish the authorities will not be too interested in digging deep into your affairs. But if you are a big fish, depending which tax officer investigates you, they could give you a hard time and interpret things to suite themselves. The big boys use tax experts who know most tricks in the book.