I understand that one should reside in Spain for six months in order to renew their residency card (TIE). I am referring to the non-lucrative residency permit.

How are the total number of days calculated by the ExtranjerÃ*a? Do they simply look at the stamps in the passport? Do they check an electronic record from the passport control/police at the airport? What are the chances of getting a renewal approved if someone has spent just under six months in the year in Spain?