This answer is from the perspective that we do not enter into eternal heaven after death, but await Christ's second coming and the resurrection in an intermediate state.
First, we must go a bit further back in the passage than the question quotes. I will be doing this in a commentary like style, all brackets and emphasis is mine.
Opening Observations
The first thing that becomes evident is Paul's choice of words to describe these bodies. The earthly one is a tent, connoting a temporary dwelling, perhaps even recalling thoughts of Israel's tabernacle tent in the wilderness. In contrast the eternal body is described as a building, a house, a more permanent structure, this time referencing the finished Temple.
Second, the our current bodies are earthly, and our eternal one is heavenly. These descriptions are qualitative, not substantive.
- The heavenly one is made by God, while ours is made by men (God made Adam's but we now produce our own).
- The heavenly one is eternal, while the earthly will be destroyed.
- The heavenly will further cloth us, cloths more and better, than the old tent.
- The mortal body is swallowed up by death, the new will swallow the old up in life.
And lastly, there is a running contrast of old to new, earthly to heavenly, mortal to immortal, temporary to eternal, perishable to imperishable: old body [OB] to new body[NB]. Recognizing this continuing point and counterpoint pattern is important to understanding the meaning of the passage.
2 Cor 5:1-10 (ESV)
1 For we know that if the tent[OB] that is our earthly home[OB] is destroyed, we have a building from God, a house[NB] not made with hands, eternal in the heavens.
2 For in this tent[OB] we groan, longing to put on our heavenly dwelling[NB],
Earthly tent to heavenly building/house.
3 if indeed by putting it[NB] on we may not be found naked.
4 For while we are still in this tent[OB], we groan, being burdened—not that we would be unclothed, but that we would be further clothed[NB], so that what is mortal[OB] may be swallowed up by life[NB].
The heavenly one will further cloth us, will be better than our current and will be swallowed up in life. Our current bodies are swallowed up in death but when perishable puts on imperishable, death in our bodies will be conquered: 1 Cor 15:54
54 When the perishable puts on the imperishable, and the mortal puts on immortality, then shall come to pass the saying that is written:
“Death is swallowed up in victory.” (Isaiah 25:8)
The key point here to not misunderstanding verse 8 is the point that we are not to be unclothed, that is, without a body, but rather the new will replaced the old. No where in any of Paul's descriptions is there a condition without either body that Paul wants. He, in fact, expressly does not want to be unclothed, that is, being found naked without the mortal body, but still without the new immortal body.
5 He who has prepared us for this very thing is God, who has given us the Spirit as a guarantee.
6 So we are always of good courage. We know that while we are at home in the body[OB] we are away from the Lord,
7 for we walk by faith, not by sight.
8 Yes, we are of good courage, and we would rather be away from the body[OB] and at home[NB]with the Lord.
First, v8 is a clear reversal of v6. Instead of being home in the body and away from the Lord, Paul wants to be away from the body and at home with the Lord. The "body" here must be identified not as any and all bodies, but as the old body.
The contrast of the whole chapter thus far continues and by now we should know of what and when this is describing. We will not be away from our mortal body, naked and unclothed, without being clothed in our heavenly body. So to be away from this body means to be clothed in the next.
What is this really talking about? As we saw in v1 our current home is our earthly body and while in it we are separated, away, from true union with the Lord.
But the emphasis from v5-7 is in having faith, in taking courage and the Spirit being a guarantee. Faith in what? That we will be further clothed when at home with the Lord.
9 So whether we are at home[OB] or away[NB], we make it our aim to please him.
Whether we are in this body or in our eternal body, we aim to please the Lord. The pattern continues, there is no new "away" option that does not involve one of the two bodies.
10 For we must all appear before the judgment seat of Christ, so that each one may receive what is due for what he has done in the body, whether good or evil.
Those who would quote v8 but take it out of its v10 context do it injustice. v10 is telling us that we will not receive our reward until the judgment seat of Christ. This is the context and focus point that Paul has in mind. Paul always points to Christ's coming and our resurrection, never to heaven, as our reward and hope.
Greek
If we examine the original Greek we see there are two words used here that are very uncommon. These words are translated in most modern translations, including the ESV I’ve quoted above, as Home and Away.
In an excellent answer to the question "Meaning of ἐνδημέω and ἐκδημέω in 2 Cor 5?" the author summarizes:
The apostle Paul uses the verbs ἐκδημέω and ἐνδημέω according to δῆμος in the sense of “country.” Thus, the verb ἐκδημέω means “to be out of (ἐξ) the country,” which is synonymous with “to be away from home,” “to travel abroad,” or “to emmigrate.” The verb ἐνδημέω means to be “in (ἐν) the country,” which is synonymous with “to be at home.” 2
After examining the usage and context of these two words used by Paul within this passage, the author ultimately concludes:
he[Paul] seems intent on discussing the mortal (corruptible, physical) v. immortal (incorruptible, spiritual) bodies.” 2
The KJV rendering of “present” and “absent” has likely helped to propagate the idea that verses 6 and 8 are saying when we leave our earthly bodies we will go to be present with, or in the presence of, the Lord (irrespective of a heavenly body). However, as the evaluation above reflects, and as most major modern translations agree, the translation as “home” and “away” is truer to the original language.
Conclusion
So we see that those who quote v8 alone as proof we go to be with the Lord when the body dies misunderstand the point. Paul is telling us to be encouraged that we have a guarantee that we will not be left in these mortal bodies and separated from the Lord, but rather to have faith that Christ will come again and resurrect us in eternal bodies. He will neither leave us in our old, nor leave us naked and unclothed, but He will cloth us further and better when we are with Him when He comes again.
This passage is not saying we do not go into the presence of the Lord in the intermediate state between death and the resurrection, but it also does not say that we do. Rather, it has little to say directly about the intermediate state. We could reason that it does say we are unclothed of any body during the intermediate state, since Paul affirms we do not receive the new body until the resurrection. But that does not preclude the possibility that biblical writers see man as continuing to be clothed in the earthly body, even in death, until the resurrection.