When buying a holiday home, where you buy will depend on the time of year you will use it and also what you like to do. Age and hobbies will be a factor.
When buying a permanent home you need to be more thorough. Again age is a factor, do you have a family, or are you retired or need to work. The style of property, that is more suited to permanent living. The location ideally needs to be not too touristic to ensure continuity of services throughout the year. Things like amenities – schools/hospitals etc. Job opportunities and access will be important. How good is public transport if you don't want to drive abroad?
When buying an investment property, is this to flip (which is not common in Spain) or for the rental market. Holiday lets need to be in the tourist sectors and the long lets in the more residential areas. The 2 bed apartment is the most common purchase for investment. Multiple purchases or one large investment in excess of €500,000.00 entitles the investor to apply for a Golden Visa