After listening to third verse, one might doubt that there are two independent paths which lead to moksa. To resolve such doubt, Lord Krsna said:
na karmaṇāmanārambhānnaiṣkarmyaṃ puruṣo'śnute |
na ca sannyasanādeva siddhiṃ samadhigacchati ||3.4||
A person does not gain the state of actionlessness by non-performance of actions. Nor does the person attain success (liberation) out of mere renunciation, sannyāsa.
"A person does not gain the state of actionlessness by non-performance of actions".
Naiṣkarmyaṃ - actionlessness means liberation, being free even though one is doing action. Because there is no one can avoid doing action (verse 3-5). Therefore there must be a way for one to do action without being bound by it, otherwise moksa is not possible. How to do action without being bound? Only with the attitude of karma-yoga, follow by self-knowledge, one attains actionlessness / liberation - Naiṣkarmyaṃ.
When one associates with his/her action is called doer - kartā, and when one enjoys the result of the action is called experiencer - bhokta. Being a doer/experiencer, I-ness - ahamkāra has to be there. Ahamkāra is the notion of isolated "I" in this body-mind-complex due to identification. Because of the isolated identification, I become limited by this body-mind-complex and actions done by this body-mind-complex. Only through karma-yoga, one thinned down one's ahamkāra by doing more satvic-action (action which benefits others more than oneself), lessen rajasic-action (action which benefits oneself more than others), and avoid tamasic-action (action which harms others). By these practice, identification with limited non-ātmā becomes lesser and identification with limitless ātmā becomes more. Only when one recognises his true nature as non-doer/non-experiencer ātmā, then one gains the state of actionlessness which is liberation itself. Therefore one does not attain liberation without following the life of karma-yoga.
"Nor does the person attain success (liberation) out of mere renunciation, sannyāsa."
By mere renunciation of action (taking up sannyāsa-āśrama without owning up the self knowledge), one doesn't attain liberation. Because no matter how much karma is exempted as a sannyāsī, one cannot avoid karma at all, even śravana, manana and nididhyāsana are karma. Therefore as long as the doer-ship/enjoyer-ship is there, it binds the person. Only by owning up the knowledge of "I am non-doer ātmā", one can attain actionlessness / liberation/success.
Doer-ship/enjoyer-ship can't be given up, because when one decides to give up, he/she employs the doer-ship. Therefore doer-ship is impossible to be given up, it goes away only when the wake of knowledge that "I am ātmā" which is non-doer. This knowledge alone negate the doership in ātmā.
Therefore one doesn't get moksa by giving up action and also it is impossible to be given up. The reason we cannot avoid doing action is answered in next verse.