That's one of the toughest statements of Jesus in all of the New Testament. Some seminary students may recall that the famous New Testament scholar, missionary, and musician Albert Schweitzer wrote his principal work in which he confessed his difficulty with Jesus' identity precisely because of that passage and the sister passages from the other Gospels that refer to that discourse on the Mount of Olives.
Jesus was talking to his disciples, and in this particular context he was talking about the temple. He said that the time will come when not one stone will be left upon another, and he pointed to the walls of the temple of Jerusalem, saying that they would be destroyed and trampled underfoot. In that same discourse he talked presumably about the consummation of his kingdom and his glorious return at the end of the age. The disciples come to him, and they ask, "When will these things take place?" He says on one occasion that "this generation will not pass away until all of these things take place." Other statements he makes are, "You won't go over all of the cities of Israel until these things take place" and, "Some of you will not taste of death until all of these things take place."
Schweitzer looked at that and said that it's obvious that some of the hearers of Jesus died before everything that he announced in the Olivet discourse took place and that the Jewish missionaries did not go over all of the nations. They still haven't covered all of the nations of the world. He said that that generation has passed away and Jesus hasn't returned. So the conclusion was wrong, and Jesus died in disillusionment. According to Schweitzer, this represented Jesus' hope that God would bring the kingdom of God in that generation, but it didn't happen.
Radical scholars say that the second generation of Christians had to revise the teaching of Jesus in order to account for this great blunder on the part of their teacher. They said that he announced his coming well before it actually happened. Some try to squeeze the text to say that in the phrase "this generation will not pass away," Jesus is using the term generation not to describe an age group but a type of person. Jesus called people a wicked and adulterous generation. He was simply saying that this kind of wickedness and this kind of sinfulness will be around until he comes back. That may be what Jesus meant.
I think there's a better explanation, although there's not space for the details of it here. Technical scholars in the New Testament have given close attention to the function of the phrase "all of these things," which is two Greek words, ponta touta. When Jesus uses those terms, he uses specific reference to the destruction of Jerusalem, which in fact did take place in the year A.D. 70 and did take place within that generation and before many of them died.