I’m not an expert but there’s probably other people who can jump in here with more info on it.
Things to remember are the U.S. Foreign Income Exclusion up to $100,000: https://www.irs.gov/Individuals/International-Taxpayers/Foreign-Earned-Income-Exclusion
In general you pay tax where you’re a resident (e.g. Spain). Because you’re a U.S. citizen this gets more complicated:
If you are a U.S. citizen or a resident alien of the United States and you live abroad, you are taxed on your worldwide income. However, you may qualify to exclude from income up to an amount of your foreign earnings that is adjusted annually for inflation ($92,900 for 2011, $95,100 for 2012, $97,600 for 2013, $99,200 for 2014 and $100,800 for 2015). In addition, you can exclude or deduct certain foreign housing amounts.
So TL;DR everything above $100,800 you make is taxed in U.S. too. And your whole income is taxed in Spain if you’re an official resident additionally. That means double taxation if you make over $100,800.