Will the Holy Spirit leave the earth during the tribulation?

No; He will remain evident on the planet even after the church is raptured.

Watch the Teaching: When Will the Wicked One Be Revealed?