Short answer
Jesus meant that the kingdom of God (﷾) would be taken from the leaders of Israel and given to another nation. He said it in the Temple, to the chief priests and Pharisees. That morning he had cursed a fig tree that bore no fruit, and the Bible uses the fig tree as an image of Israel. Just before, he quoted the Psalm about "the stone which the builders rejected" becoming "the head of the corner". Muslims see that nation in the community that began among the children of Ishmael. Abraham's household sent Ishmael away, but God (﷾) promised to make him a great nation. Six centuries after Jesus, the Prophet Muhammad (ﷺ), a descendant of Ishmael, compared the prophets to a fine house with one corner brick missing. He said he was that brick, and the last of the prophets. So Muslims read Jesus' words as pointing to that community.
Full explanation
The kingdom given to another nation
In Matthew 21, Jesus tells a parable, a story with a meaning, about a vineyard. The hearers say the owner will give his vineyard to other tenant farmers, who will pay him the fruits. Then Jesus quotes the Psalm of the rejected stone. He says plainly that the kingdom of God (﷾) will be taken from his hearers and given to a nation that brings forth its fruits. Matthew records that the chief priests and the Pharisees, a Jewish group who taught the Law, knew he was speaking about them.
“Hear another parable: There was a certain householder, which planted a vineyard, and hedged it round about, and digged a winepress in it, and built a tower, and let it out to husbandmen, and went into a far country: And when the time of the fruit drew near, he sent his servants to the husbandmen, that they might receive the fruits of it. And the husbandmen took his servants, and beat one, and killed another, and stoned another. Again, he sent other servants more than the first: and they did unto them likewise. But last of all he sent unto them his son, saying, They will reverence my son. But when the husbandmen saw the son, they said among themselves, This is the heir; come, let us kill him, and let us seize on his inheritance. And they caught him, and cast him out of the vineyard, and slew him. When the lord therefore of the vineyard cometh, what will he do unto those husbandmen? They say unto him, He will miserably destroy those wicked men, and will let out his vineyard unto other husbandmen, which shall render him the fruits in their seasons.”
“Jesus saith unto them, Did ye never read in the scriptures, The stone which the builders rejected, the same is become the head of the corner: this is the Lord’s doing, and it is marvellous in our eyes? Therefore say I unto you, The kingdom of God shall be taken from you, and given to a nation bringing forth the fruits thereof.”
“And when the chief priests and Pharisees had heard his parables, they perceived that he spake of them.”
“The stone which the builders refused is become the head stone of the corner.”
The fig tree with no fruit
Earlier in the same chapter, Jesus gave a warning about fruit. On his way into Jerusalem Jesus found a fig tree with leaves but no fruit, and cursed it so that it withered. In Luke he tells of a fig tree that bore nothing for three years and was given one year more before being cut down. The prophets had used the fig tree as an image of Israel. Both scenes speak of a people given every chance to bear fruit, and then judged.
“And when he saw a fig tree in the way, he came to it, and found nothing thereon, but leaves only, and said unto it, Let no fruit grow on thee henceforward for ever. And presently the fig tree withered away.”
“He spake also this parable; A certain man had a fig tree planted in his vineyard; and he came and sought fruit thereon, and found none. Then said he unto the dresser of his vineyard, Behold, these three years I come seeking fruit on this fig tree, and find none: cut it down; why cumbereth it the ground? And he answering said unto him, Lord, let it alone this year also, till I shall dig about it, and dung it: And if it bear fruit, well: and if not, then after that thou shalt cut it down.”
“I found Israel like grapes in the wilderness; I saw your fathers as the firstripe in the fig tree at her first time: but they went to Baal–peor, and separated themselves unto that shame; and their abominations were according as they loved.”
How Christians read the passage
Christians read the rejected stone as Jesus himself. Peter, one of his disciples, says so to the Jewish council in the Book of Acts. His first letter calls the believers "an holy nation". On this reading the kingdom passed from Israel's leaders to the church. The church is the Christian community, made up of Jews and Gentiles (non-Jews) who believe in Christ.
“This is the stone which was set at nought of you builders, which is become the head of the corner.”
“But ye are a chosen generation, a royal priesthood, an holy nation, a peculiar people; that ye should shew forth the praises of him who hath called you out of darkness into his marvellous light:”
The son Abraham's household sent away
Jesus spoke of a nation, and the Bible already names a nation that God (﷾) promised. Sarah told Abraham to cast out Hagar and her son, saying Ishmael would not share Isaac's inheritance. Yet in the same chapter God (﷾) promised twice that He would make of Ishmael a nation, a great nation. The line that Abraham's household set aside is the line from which the Prophet Muhammad (ﷺ) came. The people that grew from it received the last revelation.
“Wherefore she said unto Abraham, Cast out this bondwoman and her son: for the son of this bondwoman shall not be heir with my son, even with Isaac.”
“And also of the son of the bondwoman will I make a nation, because he is thy seed.”
“Arise, lift up the lad, and hold him in thine hand; for I will make him a great nation.”
A stone that crushes
Jesus adds, in Matthew and in Luke, that whoever falls on this stone will be broken. Whoever it falls on will be ground to powder. The image recalls Daniel's stone, which breaks kingdoms in pieces and becomes a kingdom that stands for ever. It is kingdoms that fall, not peoples. Two great empires ruled the region then: Byzantium (the Eastern Roman empire) and Persia. Within about ten years of the Prophet's (ﷺ) death, they had lost Syria, Egypt and the Persian capital to the new nation.
“And whosoever shall fall on this stone shall be broken: but on whomsoever it shall fall, it will grind him to powder.”
“Whosoever shall fall upon that stone shall be broken; but on whomsoever it shall fall, it will grind him to powder.”
“And in the days of these kings shall the God of heaven set up a kingdom, which shall never be destroyed: and the kingdom shall not be left to other people, but it shall break in pieces and consume all these kingdoms, and it shall stand for ever. Forasmuch as thou sawest that the stone was cut out of the mountain without hands, and that it brake in pieces the iron, the brass, the clay, the silver, and the gold; the great God hath made known to the king what shall come to pass hereafter: and the dream is certain, and the interpretation thereof sure.”
A narrative history of the early Muslim conquests. It describes the fall of Syria and Jerusalem, the fall of the Persian capital Ctesiphon with its royal treasure in the 630s, and the conquest of Egypt by the early 640s, all within about a decade of the Prophet's (ﷺ) death.
The missing corner brick
The Prophet (ﷺ) described the prophets before him as a man who built a fine house but left one brick missing in a corner. People walked round it, admired it, and wished the brick were in place. He said that he was that brick, and the last of the prophets. The stone of Jesus' saying and the brick of the Prophet's (ﷺ) are set in the same place: the corner.
Abu Hurayra reports that the Prophet (ﷺ) compared himself and the prophets before him to a man who built a fine house but left the place of one brick empty in a corner. People walked round it, admired it, and wished the brick were in place. He said: I am that brick, and I am the last of the prophets.
Verse by verse
Acts 4:11 — Acts of the Apostles, chapter 4, verse 11
“This is the stone which was set at nought of you builders, which is become the head of the corner.”
Cited for
In the parable just before, the vineyard owner's son is killed by the tenants. That son is Jesus, and Peter in Acts names him as the rejected stone.
The response
Whoever the stone is, Jesus' next words name what happens to the kingdom. It is taken from the chief priests and Pharisees, who knew he meant them (21:45). It is given to a nation (ethnos, the Greek word for nation) that brings forth its fruits. God (﷾) had already promised a nation to Ishmael, twice in Genesis 21.
Where it lands — Jesus says the kingdom passes from Israel's leaders to a nation; the Islamic reading identifies that nation with the one God (﷾) promised to Ishmael.
1 Peter 2:9 — First Epistle of Peter, chapter 2, verse 9
“But ye are a chosen generation, a royal priesthood, an holy nation, a peculiar people; that ye should shew forth the praises of him who hath called you out of darkness into his marvellous light:”
Cited for
The church is the "holy nation", so the kingdom passed to the Christian church.
The response
Jesus said the kingdom would be taken from his hearers and given to a nation. God (﷾) had already promised a nation to Ishmael, the son Abraham's household sent away, twice in Genesis 21. The community that began among Ishmael's sons received the last scripture and grew to include every people that accepted it.
Where it lands — Jesus spoke of a nation, and God (﷾) had promised a nation to Ishmael; the community that began among Ishmael's sons fits that promise.
Perspectives
Mainstream Christian
The kingdom was taken from Israel's faithless leaders and given to the church. Jesus is the rejected stone, raised by God to be the head of the corner.
Peter tells the Jewish council that Jesus is the stone the builders set at nought.
Rebuttal
Peter does apply the stone to Jesus. But whoever the stone is, Jesus' own next words say the kingdom is taken from the chief priests and Pharisees. It is given to a nation, and God (﷾) had already promised a nation to Ishmael, the son Abraham's household sent away.
Peter's first letter calls the believers a holy nation, so the church is the nation of Matthew 21:43.
Rebuttal
Peter does call the believers "an holy nation", but that is his letter, not Jesus' words. Jesus said the kingdom would be taken from his hearers and given to a nation bearing its fruits. Genesis names the nation God (﷾) promised to the son Abraham's household sent away, and the last scripture came to that line.
The Islamic perspective
Jesus foretold that the leadership of God's (﷾) people would pass from Israel to another nation. That nation began among the sons of Ishmael, the line Abraham's household sent away. The Prophet Muhammad (ﷺ) is the corner brick that completed the house of prophethood.
Jesus said the kingdom of God (﷾) would be taken from the chief priests and Pharisees. It would be given to another nation.
The fruitless fig tree, cursed and given a last year, pictures a people whose time of trust was running out.
God (﷾) promised to make Ishmael, the son sent away from Abraham's house, a great nation.
The Prophet (ﷺ) called himself the missing corner brick and the last of the prophets.
The rejected stone becomes the head of the corner. It is the line of Ishmael, completed in the Prophet Muhammad (ﷺ).