In Andalucia it is now 6 years for properties completed after the implementation of Decree 2/2012 of 10th January 2012.
Prior to that date the proscription period was 4 years as the previous poster has stated.
Whether or not the property can be made legal is debatable.
A property is never proscribed from prosecution if located on protected land and unless it can be absorbed unto urban land (at a cost to the landowner/homeowner) is will never be fully legal.
If it remains on non urban land it may be assimilated to the regimen of fuera de ordenacion (which in laymans terms means illegal in origins but tolerated). This also carries a cost and you my not be able to raise a mortage on the property.
Regards,
Maura Hillen
President AUAN (www.almanzora-au.org)