Who was the leader of Iran before the Shah?

There was none. Ever since the founding of the Persian Empire, which happened many centuries B.C. Iran was always under a Shah (king.)

The last change between dynasties occurred in 1925 when Reza Khan Pahlavi led a military coup that successfully overthrew Ahmed Qajjar of the Qajjar Dynasty (which had been in power since the 1700s). It is Reza Pahlavi and his son Mohammed Reza Pahlavi who are usually referred to in the West as the "Shah", but as mentioned above, this term is very old. Mohammed Reza Pahlavi was overthrown in the Islamic Revolution.