And what would you do if (as in your case here) Spain says that we do not recognize that you live in Bulgaria and therefore you must pay tax in Spain? Then you would have to pay tax both in Bulgaria and in Spain.
exactly my point!The problem in general is not the country where you pay taxes but the country where you avoid them. If you stay in Spain for a long time of the year you might run into trouble with Spanish authorities.