France's ruling Socialist Party formally rejected today the idea of serving as junior partners in a coalition government in case of an indecisive outcome to crucial legislative elections next March.

The agreement on a postelectoral strategy followed a night of hard bargaining between different factions at the party's decision-making congress here. It also marked the opening in earnest of a Socialist campaign to win back voters disillusioned by a series of political and economic reverses since the left-wing election victory in May 1981.

The party resolution could lead to an unprecedented situation in French politics under the Fifth Republic. It implies that the Socialists would go into opposition if they lose the elections even though their leader, President Francois Mitterrand, will still have two years of his seven-year term left to serve.

The three-day congress ended with an emotional display of party unity as leaders of the rival ideological clans gathered together on the podium to rhythmic applause from the 2,000 delegates. Each leader clutched a red rose, the Socialist Party symbol, as they stood under a huge banner reading " '86: Confirm the Progress."

The party, whose political spectrum ranges from hard-line Marxists to pragmatic social democrats, has devoted much of the past few months to a bruising internal debate about its electoral image. At the heart of the discussion has been the question of how to react in the likely event of electoral defeat next March.

The resolution rejecting an alliance with the right marked a victory for Socialist leader Lionel Jospin, who is anxious to preserve a clear left-wing identity for his party. His strategy is aimed at consolidating the Socialists as the leading party of the left and profiting from the decline of the Communists.

The key passage in the party resolution, which was endorsed by an overwhelming vote, read as follows: "If the Socialist Party does not have sufficient seats or sufficient allies to govern on the basis of its own proposals and values, and on a left-wing policy, it will be in opposition."

The resolution left open the slight possibility that the Socialists might be able to form a minority government with support from the centrists if the election produces a political stalemate.

In return for agreeing to reject the idea of joining a conservative-led coalition, the party's social democratic faction led by former agriculture minister Michel Rocard managed to secure some concessions from the left. The final resolution included a passage explicitly recognizing the "economic constraints" to the implementation of a socialist program.

Rocard, who resigned as agriculture minister earlier this year after disagreements over economic policy and the introduction of proportional representation, has criticized attempts by the Socialists to expand the economy during the first two years of left-wing rule. At his insistence, the final resolution omitted a reference to the "justification" of the government's initial expansionary economic policies.

Maintaining that the congress had confirmed "a cultural transformation" of the party, Rocard said: "No longer are there two socialisms, one of government, the other of opposition; one of management, the other of utopia."