Yanukovych fled because even his own party turned on him after police snipers killed over a hundred people. Instead of securing a political deal with other parties to safeguard his future (as he had hoped), he faced the possibility of arrest and criminal prosecution. So he just ran away before it could happen, left Ukraine for Russia and never returned.
Ukraine's parliament assembled and unanimously scheduled a snap presidential election, which was held a few months later. The Ukrainian people subsequently elected a new president.