Why was the shah of Iran forced into exile in 1979?

His people revolted against him and wished to put him on trial for the way he ran their country. He decided the better option would be to flee rather than submit.