Genesis 15:18–21 shows how God supposedly promised the area of Israel to Abraham. Due to the conflict with Issac and Ismael, both Islam and Judaism (and later Christianity) would all claim to be the legitimate heir to this land. Thus, all of the Abrahamic faiths believe that they are entitled to Jerusalem.
The reason that many people believe that it was promised solely to the Jews is that the promise was supposedly reaffirmed to the Jews after the split of the two faiths. Of course, god said nothing that revoked his promise to the Muslims, so they can also claim that god promised them the land.
Reading through the Wikipedia page, it says that Jerusalem has been “captured and recaptured 44 times,” so Jerusalem has indeed been the homeland of a very large number of different groups.
The land first came under Jewish control around 1000 BCE, under the House of David. It remained under their control until 597 BCE, when it was lost to the Babylonians. The Jews were allowed to return by around 516 BCE (after the Persians took over), when the Second Temple was built, but was then taken over by the Macedonians (Alexander the Great). After his reign, and the fragmentation of his empire, it came under Jewish control with the Hasmonean dynasty from 130 – 47 BCE.
It was taken over by the Romans. Jerusalem then became the birthplace of Christianity. Under the Byzantine empire (the eastern Roman empire), the Jews were still banned from the city, but it was under Christian control. This is when the major Christian monuments were built, such as the Church of the Holy Sepulchre in the early 300s.
It came under Islamic control around the early 600’s. Muhammad is said to have journeyed to heaven in the year 621, making Jerusalem one of the holiest cities in Islam. The Dome of the Rock was built in 691 CE. The Palestinians would have control of this land for 400 years, until the Crusades established the Kingdom of Jerusalem in 1099. Both the Muslims and Jews were forced out of the city as it came under Christian control.
Jerusalem was reclaimed by the Muslims 1187 by Saladin, who permitted the worshiping of all religions. It remained under Islamic control until 1243, when the Christains took power. There was a period of unrest, but it was eventually captured by the Egyptian Mamluks, who were Muslim.
In 1517, Jerusalem was taken over by the Ottoman Empire. The Ottoman empire was based on Islam, and it retained control for 400 years, until the British took control of Palestine in 1917. In 1947, the land was partitioned between Jordan and Israel. After 1948, Jerusalem was divided between the two countries.
In 1967, Jerusalem was taken over by Irael in the Six Day War, during which Israel took over the Sinai peninsula, the West Bank, the Gaza strip, and the Golan Heights. As of now, the city is currently controlled by Israel as its unrecognized capital.