As for a hypothetical autónomo status in another country — if you are no longer carrying out any activity there, it is better to officially close it to avoid issues related to double taxation.
The general rule is: if you live in Spain and carry out your work from Spain, you are required to pay income taxes and social security contributions in Spain.
Centro de ayuda