The second verse of the Bible says, “And the Spirit of God was hovering over the face of the waters” (Genesis 1:2). The fourth from the last verse of the Bible says, “And the Spirit and the bride say, ‘Come!’” (Revelation 22:17). From beginning to end, the Holy Spirit has been involved with the happenings of the earth. I am not aware of any verse that states that the Holy Spirit will ever leave the earth. If God removed His own Spirit, He would be removing Himself, which would leave Him with no ability to accomplish anything in the earthly realm.
I cannot explain with certainty what Paul is talking about in 2 Thessaonians 2:7. But I can say that he is not talking about the Holy Spirit leaving the earth.