Despite Israeli occupation of a third of Lebanon's territory and renewed bombing against besieged West Beirut, Lebanon today formally opened its campaign to elect a new president.

Never before in 39 years of independence has the presidential political process been so fraught with dangers and the risk of partition seemed so great. For somehow during the next two months the aging members of a parliament elected 10 years ago are constitutionally required to choose a successor to President Elias Sarkis.

Lebanon's presidential elections have not been easy in the best of times--one winner was elected by one vote as his followers fired at the parliament's roof to make sure dissenters accepted the vote and Sarkis was elected in 1976 with Syrian support amid a shower of incoming mortar rounds.

The present campaign illustrates the agony of Lebanon, which is being asked to act out its most complicated political process when the country is still a battleground for the Middle East's adversaries, who over the years have demonstrated their contempt for its sovereignty, independence and territorial integrity.

The upcoming election has not drawn much attention outside of Lebanon, but Israel has insisted it wants a strong, central government to emerge following its invasion.

The United States also has consistently echoed this theme.

There are so many factors that were it not for the constitutional requirement to hold the elections this summer, the Lebanese, Palestinians, Israelis, Syrians, Saudi Arabians, Americans and other players would no doubt prefer a postponement.

The problems involved are so complex that many politicians and analysts are convinced Sarkis will have his six-year term extended by constitutional amendment for a further year or two despite his constantly reiterated desire to leave office Sept. 23.

As of now, the presidential race appears to pit an ailing Sarkis against Christian militia leader Bashir Gemayel, the only officially announced candidate.

The 35-year-old Gemayel's problem lies with the threat by his Israeli allies to assault the predominantly Moslem western sector of the capital. That attack would risk breaking altogether the rather tenuous links between the Moslem majority and the Maronite Christians, who by unwritten agreement occupy the presidency.

Since the Israeli invasion June 6, Gemayel has studiously dodged Israel's repeated efforts to enlist his militia in assaulting the besieged Palestinian guerrillas in place of the Jewish forces.

Analysts insist Gemayel was at his strongest just before the invasion when his law-and-order rule of the Christian enclave was a strong attraction for those Lebanese, many of them Moslems, who lived in the lawless areas in the rest of the country.

They were then willing to put up with his Israeli ties. But today the Moslems fear a strong Maronite leader would be tempted to try to re-establish Christian domination over the country. They are also concerned about the destruction and loss of Moslem lives in the Israeli campaign and reports circulating here of the Christian militia's tough behavior in areas occupied by the Israelis.

By law there are 99 members of parliament, but seven have died and since 1975 there has never been a peaceful period that was long enough to hold even by-elections much less a general election.

Since two-thirds of the parliament constitutes the quorum required even to meet to begin the election process, Gemayel's lieutenants argue that only 62 members must be present. His opponents claim the quorum always has been 66 and should remain so.

If no winner is chosen by Aug. 23, the parliament must meet in continuous session from Sept. 13 to Sept. 23 when Sarkis' term expires. Thereafter the constitution provides that the departing president may entrust what remains of legality to the government. Gemayel's supporters claim that he already has 60 votes in parliament, but observers are not so sure.

Even if he secures the quorum, it is far from certain that he could win even the simple majority required in all but the first ballot when a two-thirds majority is needed.

So far, Gemayel still lacks major Moslem backing, which every successful Maronite candidate has enjoyed in the past.

Saeb Salam, a former prime minister, which is an office reserved for Sunni Moslems, recalled in an interview that "the presidential elections have always been worked out by consensus without one party forcing itself on another."

Also worrying Lebanese is the strong possiblity that the "grand electors"--as the influential foreign powers are called in recognition of their traditional role in choosing presidents--will exercise their complicating influences.

At this juncture their conflicting interests are thought likely to delay the final evacuation of Palestinian, Syrian and Israeli forces, which alone could guarantee Lebanon's right to run its own affairs as it sees fit.

Israel has emerged as a major and overt player in the presidential election game for the first time. Moslems have said they will not elect a new president under the threat of Israeli bayonets--at least until the siege of West Beirut is lifted.

Syria wants to protect its position in the Bekaa Valley and to keep troops, or at least a major influence, there.

As Syria and the United States patch up their previously deteriorating relations, many Lebanese opposing the Syrian presence are convinced that they will pay the price. Specifically, they worry that the American-led negotiations over the current crisis in Lebanon will work out an agreement authorizing Syria to keep troops in the Bekaa in return for Damascus renouncing its opposition to allowing the Palestinian guerrillas and their leaders to seek refuge on Syrian soil.

At the very least, Syria is thought likely to want to veto Gemayel's candidacy. His Christian militia was a one-time ally whom the Syrians saved in 1976 only to have the Christians go over to Israel and inflict many hundreds of casualties on Syrian forces in subsequent fighting.