Group A: Patients are randomized to 1 of 3 treatment arms: NFV plus EFV placebo on Arm I; NFV placebo plus EFV on Arm II; or NFV plus EFV on Arm III. Concurrent with their randomly assigned therapy, patients receive open-label RTI therapy comprising 1 of the following 3 combinations that provides 1 or 2 new RTIs: didanosine (ddI) plus stavudine (d4T); lamivudine (3TC) plus d4T; or ddI plus 3TC. [AS PER AMENDMENT 12/02/97: Patients with virologic failure at Week 16 seek the best available therapy outside the study or continue study medication for up to 120 days.] [AS PER AMENDMENT 3/5/98: Patients with virologic failure at Week 16 now proceed to Step III.] Patients without virologic failure continue therapy during Weeks 1 to 48 [AS PER AMENDMENT 3/5/98: and those without virologic failure at Week 48 may continue therapy during Weeks 49 to 96 (first extension study)]. [AS PER AMENDMENT 5/27/99: After Week 96, patients in Arm I may switch to Arm III or seek the best available antiretroviral therapy outside the study. Patients in Arm II or III with undetectable plasma HIV RNA levels at Week 96 may continue therapy during Weeks 97 to 144 (second extension study) or seek the best alternative antiretroviral therapy. Patients in Arm II or III with detectable plasma HIV RNA levels but without virologic failure at Week 48 continue their current study therapy or proceed to Step III. Patients with confirmed virologic failure at Week 48 or later proceed to Step III or seek the best available alternative therapy outside the study.] Group B: Patients receive treatment on their assigned, open-label ACTG 302/303 regimen. Patients with detectable plasma HIV RNA levels discontinue Group B therapy and proceed to Step II. Patients with undetectable plasma HIV RNA levels continue therapy during Weeks 1 to 48 [AS PER AMENDMENT 6/24/98: and those with undetectable levels at Week 48 may continue therapy during Weeks 49 to 96 (first extension study)]. [AS PER AMENDMENT 5/27/99: Patients with undetectable levels at Week 96 may continue therapy during Weeks 97 to 144 (second extension study).] Step II: Patients receive treatment as in Group A. [Step III: AS PER AMENDMENT 3/5/98: Patients choose 1 of 3 alternative therapies: saquinavir soft gel capsule, ritonavir, adefovir dipivoxil, and L-carnitine on Arm X; EFV or NFV plus 2 new approved antiretroviral drugs outside the study on Arm Y (if no prior EFV or NFV); or best available medication outside the study on Arm Z.