The Soviet Union has praised the cease-fire in Lebanon, in an apparent sign of satisfaction at the diplomatic and territorial gains registered by Syria and the Druze in the long-running civil war.

The important role played by Syria in negotiating the cease-fire agreement has been cited by Soviet officials as one factor in explaining the Kremlin's unusually positive reaction. Syria is Moscow's principal ally in the Middle East and is a major recipient of Soviet weaponry.

Other elements in the Soviet attitude include a wish to avoid unpredictable conflicts in a sensitive region close to its borders and satisfaction at what appears to be a change in the internal balance of power in Lebanon. Western diplomats have noted that the Soviet press has resumed mentioning the name of Lebanese President Amin Gemayel in the past few days, after a period of ignoring him and his government.

Against these favorable developments, from Moscow's point of view, must be set the continuing presence of U.S. combat troops in Lebanon, which is perceived here as a threat. One of the chief aims of Soviet policy has been to avoid the construction of permanent American military bases in the Middle East.

Despite the involvement of the Syrians in the cease-fire talks, there is no evidence that the Kremlin is closer to its long-term goal of winning a place for itself at the negotiating table. Soviet spokesmen have made plain their belief that there can be no lasting peace settlement in the Middle East without their participation.

The United States opposes Soviet involvement in peace negotiations on grounds that the Kremlin has not shown that it is prepared to take a "constructive attitude."

The first sign of an adjustment in the Soviet position on Lebanon came in a speech Tuesday by Soviet Foreign Minister Andrei Gromyko in which he described the cease-fire as having "positive significance." Yesterday, Soviet leader Yuri Andropov also welcomed the cease-fire during a meeting with South Yemeni President Ali Nasser Mohammed Hasani and said he hoped that it would lead to "a complete all-round settlement on the basis of national accord."

Official Soviet statements have gone on to demand the withdrawal from Lebanon of both Israeli occupation troops and the U.S.-backed multinational force. They also have accused U.S. Marines in that force of "direct armed intervention" and depicted the United States as acting hand-in-glove with Israel in the Middle East.

The more positive tone of recent Soviet statements also seems to reflect satisfaction at the way in which events have moved in the Middle East since last year's Israeli invasion of Lebanon. The superiority of American military technology in the hands of the Israelis over Soviet tanks, planes and rockets in the hands of the Syrians and Palestinians was widely regarded as a blow to Soviet prestige.

Since then, however, the Soviets have rearmed Syria with large quantities of sophisticated military equipment, including an upgraded air defense system based on a network of SA5 surface-to-air missiles. According to testimony given to Congress by Secretary of State George P. Shultz, about 7,000 Soviet military advisers now are in Syria manning these missile batteries.

In all, Soviet strategists seem to have made some progress toward their goal of gradually rebuilding Moscow's standing as an influential power in the region, after it had been undermined by successive Israeli victories over the Arabs and political setbacks in such countries as Egypt and Somalia. The Soviets also have managed to score propaganda points with other Arab countries by attacking U.S. imperialism.

Echoing a constant Soviet theme, Gromyko described U.S. policy in the Middle East as "hostile toward the Arabs." He said that U.S. Marines openly were acting as an occupying force and were no different from "the colonizers of the past, who enslaved peoples by sword and fire."

In contrast, the Soviet Union has sought to depict itself as a true friend of the Arab world, eager to avoid any direct intervention.

"The Russians are hated when they seek to impose themselves. But they are now gaining credibility by being more restrained and waiting for the Arabs to come to them for favors," a Middle Eastern diplomat here remarked.

There has been a steady stream of visits to Moscow over the last few months by Syrian and Palestinian delegations. Walid Jumblatt, the Lebanese Druze leader whose militiamen took the offensive in the recent fighting, also has been a frequent visitor.

One of the key factors molding Moscow's attitude to events in Lebanon is its complicated relationship with Syria. The two countries signed a friendship treaty in October 1980, but western diplomats here say it is incorrect to consider Syrian President Hafez Assad a pawn of the Kremlin.

"The Syrians depend on the Soviets for arms. The Soviets depend on their role as an arms supplier for their influence in Syria. Their relationship is as simple as that," a western diplomat here said.

In the past, Assad has shown that he can be a difficult ally, more concerned with pursuing his own aims than in promoting Soviet objectives in the Middle East. The most notable example occurred in 1976, when Syria sent its troops into Lebanon against Soviet advice.

To add insult to injury, then-prime minister Alexei Kosygin was in Damascus at the time and only learned of the Syrian move in a telephone call from Moscow.

A complicating factor in the relationship is Soviet ties to the leader of the Palestine Liberation Organization, Yasser Arafat, who recently returned to Lebanon for the first time since being expelled by Syrian authorities from Syria and Syrian-controlled portions of Lebanon three months ago. The Kremlin has tried not to get involved in Arafat's quarrel with the Syrians and instead has preached the need for Arab and Palestinian unity.

It is unclear to what extent the relatively low-key approach adopted by the Soviets in the Middle East has been a conscious strategy decision and to what extent it has been forced upon them by events.

"I rather think they do not have any great master plan at present," one western diplomat said. "Instead they simply take every opportunity of embarrassing the Americans and increasing their influence among the Arabs."