Anyone who spends fewer than 183 days in Spain a year is considered non-resident for tax purposes; the rule applies to EU and non-EU citizens alike.
A non-resident property owner is taxed on Spanish assets only, for most that’s just your Spanish property.
There are two property-related taxes on non-residents and both are calculated on the cadastral value, not the actual value. If a non-resident owner rents out their property then the income is subject to tax at a flat rate of 24%.
If you spend more than 183 days a year in Spain you are fiscally resident and will be taxed on worldwide assets. Spain and the United States do have a double taxation treaty.