Without becoming a legal resident in Spain, the 90-day rule is applicable, and you cannot extend your stay. So, for periods longer than 90 days, you will need a long-stay visa and a residence permit, which means you need to become a resident if you want to stay long-term in Spain.