If you are a resident in Spain and have exchanged your UK licence for a Spanish licence, you will be able to continue to use this when you visit the UK from 1st January 2021; you will NOT need an International Driving Permit (IDP).
If you are resident in Spain and have not been able to start the process to exchange your licence before 30th December, you should sign up for email alerts at gov.uk/livinginspain to get updates on the future exchange of driving licences. In the meantime, you can use your valid UK licence to drive in Spain until 30 June 2021.
If you move back to the UK and hold a Spanish licence, you will be able to exchange it for a UK one without having to take a test.If you are visiting Spain (you are not a resident) and hold a UK driving licence, you will not need an IDP for driving in the EU after 1 January 2021, but you might need a green card and GB sticker. Check www.gov.uk/visit-europe-1-january-2021 for more info.