Italian Premier Giulio Andreotti tonight announced the formation of a new, three-party government, officially ending Italy's eight-week old political crisis.

The new government of Christian Democrats, Social Democrats and Republicans does not command a parliamentary majority, however, and is expected to be short-lived. Andreotti's 21-member Cabinet of Christian Democrats and representatives of the two small centrist parties is almost certain to be defeated in a vote of confidence later this month.

Such a defeat -- taken for granted by most political leaders here -- will make early elections inevitable. Thus, in late May or early June, Italians will likely go to the polls two years ahead of schedule to vote, although indirectly, on contemporary Italy's major dilemma: future relations between the powerful Communists and the ruling Christian Democrats.

The major task of the government presented tonight to President Sandro Pertini will be to lead the country during the preelection period. It will be Italy's first coalition government in three years.

The Christian Democrats, who took most of the important ministerial positions for themselves, gave four posts, including that of deputy premier, to three members of the small but influential Republican Party and four posts to the Social Democrats. Inside sources said the concession were meant to indicate that the party intends to pursue the national unity alliance that in one form or another has governed Italy since August 1976.

Andreotti, 60, presented his fifth government 48 days after a Communist decision to withdraw support forced the collapse of an earlier all-Christian Democratic government, the first in 31 years to have formal Marxist backing.

The Communists decision to pull out of a five-party alliance that had supported Andreotti for 10 months reflected the growing conviction of party leaders that their status of influence without Cabinet posts simply was not paying off.They appear willing to face an election despite forecasts that indicate the Communists will incur some loses.

Communist leaders have said in private recently that they now believe that they will be able to influence events in Italy only when they are allowed to join a coalition. They say they are convinced that the Christian Democrats, who cannot govern alone, will quickly realize that Communist backing is crucial.

The only alternative to some sort of Communist -- Christian Democratic agreement would appear to be a Socialist return to the Christian Democrat-Socialist center-left alignment that governed Italy throughout the 1960s and in the early 1970s.