A former president of the Maldives will run in elections later this year after the Supreme Court ruling has quashed his conviction for terrorism offences.