More than a year after it entered the Lebanese civil war, Syria finds itself with almost 30,000 of its crack troops stuck there enforcing a shaky peace. Government officials and diplomats here say Syria wants to get them out as soon as possible.

Before the troops pull out, Syria wants to make sure it is leaving behind a Lebanese government that is strong, stable and - above all - friendly to Syria.

While some officials here may harbor the dream of rebuilding the Greater Syria of the pre-World 1 Ottoman Empire with Damascus as its capital, there is no indication that they want to achieve it through occupation.

Rather, diplomats here believe, they are trying to extend their hegemony over this part of the Middle East through political means. They have already forged close ties with Jordan that could blossom into a full fledged federation. The Palestine Liberation Organization is firmly under Syria's control, and presumably Syria would be influential in any Palestinian state set up on the West Bank of the Jordan River and the Gaza Strip.

With Lebanon under its influence, Syria would once again have a major outlet to the sea as it had during the 500-year Turkish rule during the Ottoman empire.

Right now, Syria's control in Lebanon is exercised primarily through its troops, which make up the bulk of the Aram peace-keeping force that ended 19 months of civil war in November. There is no effective Lebanese army.The religious, social and economic differences that divided the country before the fighting still prevail, and the Palestinian presence continues to be heavy.

In many ways, Damascus is the capital of Lebanon. More major decisions on Lebanese matters are made here than in Beirut, and Lebanese politicians of both right and left come here often.

Syrian officials here express doubt that they can pull their troops out of Lebanon until the government of President Elias Sarkis - who is considered pro-Syrian - has firm control over the country.

"We want to get out," said Assad Elias, press secretary to Syrian President Hafez Assad. "But we don't want to leave chaos. We want to leave Sarkis strongly in control."

Assad has said he expects that his troops will have to remain in Lebanon for at least another year.

Faced with the delicate job of keeping a balance between leftists and rightists, Christians and Moslems, Palestinians and Lebanese, Syria has hit first one faction, then another.

The Palestinians were the first target. Syrian tanks and troops, ringing their camps, assisted by the Syrian-backed Saiqa Palestinians, moved in on the leftist Rejection Front groups who oppose any settlement with Israel. At the same time, Syria forced the mainstream Palestinian groups to go along with its policies and gained control over all weapons and supplies going to Palestinian fighters.

More recently, the Syrians have begun cracking the whip over rightist Christians, first by subtly moving troops into Christian parts of Beirut and harassing leaders such as the Phalange Party's Beshir Gemayal.

Last month, the Syrians actively supported Palestinian fighter Lebanese's southern border with Israel. They broke a security belt set up by Israeli-supported rightist Christians along the border, and then Syria called the Palestinians off.

With the Soviet Union finally giving its imprimatur to the Syrian intervention in Lebanon - after strongly opposing it a year ago - Syria began to crack down on the Lebanese left three weeks ago.

All the while, Syria has been trying to prop up the Sarkis government. Its representative on the four-party committee supervising the peace in Lebanon, Col. Mohammed Kholi, insisted against the wishes of other Arab states on the committee - Egypt, Saudi Arabia and Kuwait - that all heavy weapons be turned in.

All this has cost Syria money, according to government officials here.

The oil-rich Arab states pledged to pay $30 million of the first six months' cost of peacekeeping force and little if any of the second six months, a government source here said.

Syria's information minister, Ahmed Iskanadar Ahmed, said, "It costs us fore than $90 million every six months."