The 2 kingdoms before Babylon are Egypt and Assyria.
It could be when the Bible says the beast has 7 heads,that it means that Satan is the one that influenced the 7 world powers,referred to as kingdoms,and the 10 horns is Satan influencing the world by the world divided in to 10 sections with a leader in each section,who wait for the beast,the man of sin,to appear claiming to be God,to hand their power over to him.
The Bible says that the beast is the 8th king,and is of the 7 heads,or kings,which seems to infer that Satan influenced the 7 kingdoms,and is not of God.It seems like God is telling us that however those 7 kingdoms operated it is not of Him,at least not in it's entirety,for we see that in all of them there was an acknowledging of God,but still they held unto their heathen ways,and whatever knowledge they did have about God,they forgot it in the future.
The 7 heads or kingdoms seem to be Egypt,Assyria,Babylon,Medo-Persia,Greece,Roman Empire,the 10 horn kingdom.
It says 5 of the kingdoms are fallen,and the time John wrote Revelation the first 5 kingdoms were not in power.
John said one is in operation,and at that time the Roman Empire was ruling.
John said one is to come,which is the 7th king,the 10 horn kingdom,which will continue for a small time,which the 10 horn kingdom will rule during the first half of the 7 years tribulation period without the beast,which is a small time.
The beast is the 8th king,the man of sin.
In Revelation chapter 12,it says the crowns are on the heads,which seems to mean Satan deceiving the world in the spiritual realm by the 7 kingdoms.
In Revelation chapter 13,the crowns are on the horns,which seems to mean Satan deceiving the world in the physical realm as the beast,and the Bible says the 10 horns rule with the beast for one hour.
In chapter 13 it says one of it's heads was wounded and healed,which could mean that the 10 horns,the 7th head,could not handle the problems on earth during the first half of the tribulation,because of the 6th trumpet of a 200,000,000 men army that fights the world,which seems to be the Muslim world against the world,because they do not like the operation of the one world government and one world religious system,although the Arab governments will comply,at least at first when the world comes together.
God said at the end of the 6th trumpet,that man will still not repent of their evil ways,and they go about trying to still solve their problems,so that is when God will allow the beast to rule over them.
The beast will restore order from the disaster of the war during the first half,and during his speech he convinces the world to follow his lead to solve the problems on earth,and the 10 horns is healed and operational again to rule with the beast for one hour.