No, buying an apartment/piso/house,farm/etc in Spain does not qualify you for residence. It might be one part of qualifying under independent means, but that does not entitle one to work in Spain. In essence you're showing you have sufficient money from abroad that you don't need to work. Is easiest for wealthy or retirees. Note that a large portion of the US citizens living in Spain never have received proper residence status in any category.