If a Muslim becomes a disbeliever then becomes a Muslim again, will all the good deeds done by him in his prior period of belief be sustained or will they be destroyed?
Allah (SWT) from his mercy and generosity will forgive these sins and if someone leaves Islam but comes back to it then know that Islam wipes anything that came before it like sins. Allah (SWT) also said that he will turn bad deeds into good deeds for those who repent to him and ask his forgiveness. Always remember that Allah is the Most Forgiving, Most Merciful. Allah said in the Quran that his mercy encompasses all things.