Paul has much to boast about in his Jewish/Pharisaic successes (3:4-6). But when he comes to believe Jesus as the Christ, he starts to accurately perceive them as entirely worthless. What he thought was a gain actually wound up being a loss! With this accounting language of gain and loss, Paul reveals to us the two sides of this spiritual ledger: Christ as gain and everything else as loss.
The Loss: In these verses, Paul repeatedly speaks of all his past privileges and successes as a loss. It's like he just comes to realize that these were all bad investments! So he says, "I have counted [them] as loss" (3:7). In this first statement, he describes this initial realization on the Damascus Road. He then tells us that this perspective continues on to the present: "I [continue to] count all things to be loss" (3:8a). This isn't just a moment of insight. This is an enduring perspective! Paul here also includes in this loss "all things." For him, faith in Christ not only means this new perspective and the giving up of his Pharisaic pursuits, but it also means sacrificing other things, even his safety, health, comfort and freedom. If any of these hindered following Christ, they were not worth holding on to! With this in mind, he adds graphic imagery to show his disgust toward these things: "I count them but rubbish" (3:8b). These other things are repulsive to him, because they are positively harmful. Like frivolous "investments" that lock up your finances, these keep you from giving what you must to Christ. Following Christ means putting a damper on these other pursuits that drain your time and energy and grab your attention.
The Gain: On the other side of this ledger is the blessing of God's Messiah. And in order to gain that blessing, Paul counts all things as rubbish. This is all because of Christ and "so that I may gain Christ" (3:8). Paul also shows us positively what this gain is. It is "knowing Christ Jesus my Lord." This is not mere theological knowledge but personal knowledge of Christ as "my Lord." For Paul, Pharisaic ambitions and knowing "my Lord" could not coexist. He either has Pharisaism for himself or he serves his Lord. Paul then elaborates further on this gain. First on the list is the righteousness from God based upon faith. Unlike his Pharisaic self-righteousness, God imputes His true righteousness to those who believe in His Christ. To this, he also adds the power of Christ's resurrection, which is God's power at work in His people. Lastly, he adds the privilege of sharing in the sufferings of Christ, which in some cases literally meant death. But even death is still glorious, since those who die in Christ will be raised up, just as Christ was raised up. Thus, every believer will gain the glory of Christ (3:21), in life or in death, through rapture or resurrection. What wondrous blessings are there for us who are in Christ!
 These two words show opposite and offsetting values. Cf. Matt. 16:26 where gain and loss is an "exchange."
 The singular noun "loss" points to the sum of tallying all the advantages. They actually added up to a loss!
 This is the perfect tense verb hē-gē-mai (ἥγημαι), a past action (his conversion) with present repercussions. Thenceforth, he abandoned his Pharisaism and even his own safety for his service to Christ (Acts 9:15-25).
 This brings out the imperfective aspect of the present tense verb "I count," or ē-gou-mai (ἡγοῦμαι).
 He could not be rid of his Jewish ancestry or circumcision, etc. What he actively gave up was his Pharisaism.
 His freedom was lost in jail. The rest he lost since conversion (Acts 9:18-25) and beyond (2 Cor. 11:23-27).
 This is sku-ba-lon (σκύβαλον), a graphic reference to dung/excrement (NET), muck, spoiled food and trash.
 Three times he uses the word di-a (διά) to describe cause ("because of"). He counted all things a loss "for the sake of ["because of"] Christ" in 3:7), "in view of ["because of"] the surpassing value of knowing Christ" (3:8a), and "for ["because of"] whom I have suffered the loss" (3:8b). Paul counted these as loss because of Christ.
 Paul writes about this in another letter written during this imprisonment. Eph. 1:19-20, "the surpassing greatness of His power toward us who believe… in accordance with the working of the strength of His might which He brought about in Christ, when He raised Him from the dead."
 "In order that" is literally "if somehow [ei pōs (εἴ πως)]" (NASB fn.), or "and so, somehow" (NET), or "that by any means possible" (ESV). Paul expresses doubt as to whether he will be resurrected, as opposed to rapture.
 Cf. 1 Thess. 4:16-17, "dead in Christ will rise first… we who are alive… will be caught up… to meet the Lord."