Hello dja_soft,

If your friend has been gathering documented evidence of his stay during the last 3 years in Spain ( Town hall registration, certificates of courses for irregular immigrants from the Social services Dept of the local town hall, rental contract, water and gas or electricity bills, telephone bills, medical visits, invoices for purchases, etc ) and has got a work offer/contract in place, he will be able to prepare a file for the Residency by Settlement application.

You can read about all the requirements here.

Regards,