The first occupancy license ( in Spanish Licencia de primera ocupación or cédula de habitabilidad) is issued by the technical department of the town hall.
Starting in January 2019, if you are working as intermediary between owner and tenant in a holiday rental you have a new formal obligation with Hacienda: submitting “modelo 179”.
Non-residents who obtain incomes by means of the rental of a property in Spain must file the Non-resident Income Tax. Find answer to some questions here.