All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The texts of the Quran and Sunnah clarified that people are of two types in this regard:
First, the soul of the believer: the doors of the heavens are opened for it until it reaches the seventh heaven. Al-Baraa' narrated in his long hadeeth about the story of death that the Prophet, sallallaahu ‘alayhi wa sallam, said about the believer's soul:
"...Until they (the angels) take it to the lowest heaven and ask that it be opened for it, so it is opened for them. Those who are of high rank in each heaven accompany it until they reach the next heaven, and so on until it reaches the seventh heaven. Then, Allah, may He be Glorified and Exalted, says, 'Record the book of My slave in ‘Illiyyoon (the highest places) and take him back to the earth, for I created them from it, and I shall return them to it, then I shall take them out from it again.' Then his soul is returned to his body and two angels come and make him sit up..." [Ahmad - Al-Albaani graded it saheeh (sound)]
Second, the soul of the disbeliever or dissolute person: the doors of the heavens will not be opened for it. The hadeeth reads:
"...Until they take it to the lowest heaven and ask for it to be opened, and it is not opened for him. Then the Messenger of Allah, sallallaahu ‘alayhi wa sallam, recited the verse (what means): {Indeed, those who deny Our verses and are arrogant toward them - the gates of Heaven will not be opened for them, nor will they enter Paradise, until a camel enters into the eye of a needle. And thus do We recompense the criminals.} [Quran 7:40] Then, Allah says, 'Record the book of My slave in Sijjeen, in the lowest earth,' so his soul is cast down violently..."
As for saying that some souls will only be taken to the first or second heavens, we could not find any evidence, nor any statements of Muslim scholars, in this regard.
Thus, it is clear that attaining faith is the road that takes the soul to the seventh heaven after death. True faith means the sound beliefs that conform to the Quran and Sunnah and the example of the righteous predecessors, and it requires doing good deeds. This is why Allah, The Exalted, often mentions them (faith and good deeds) together in the Quran, as in the verse: {Indeed, those who have believed and done righteous deeds - they will have the Gardens of Paradise as a lodging.} [Quran 18:107]
Allah knows best.