The Soviet Union released five of its most prominent dissidents, including human rights activist Alexander Ginzburg, yesterday in exchange for the U.S. release of two former Soviet employes of the United Nations who were convicted of espionage last year.

The dramatic and unexpected exchange took place at about 3:30 p.m. in hangar 17 of Kennedy International Airport in New York, where the five landed from Moscow on a regularly scheduled flight of Aeroflot, the Soviet national airline.

About two hours later, the same aircraft took off on its return flight to Moscow carrying the two convicted spies, Valdik Enger and Rudolf Chernyayev.

White House press secretary Jody Powell announced the exchange, the result of about six months of negotiations, with obvious satisfaction but a minimum of official fanfare. He said the immediate families of the five would join them in the United States "shortly," probably in about a week.

Administration officials described the dissidents as feeling well and said they had been taken to undisclosed government-provided accommodations to rest before making any public statements.

Of the five, Ginzburg, a writer, editor and close friend of Nobel Prize novelist Alexander Solzhenitsyn, is the best known in the United States. He has been known in the United States. He has been in and out of Soviet prisons since the early 1960s and was a founder of a dissident group established to monitor Soviet compliance with the Helsinki human rights agreement.

Despite strong protests from the Carter administration, Ginzburg was tried and convicted of anti-Soviet agitation and sentenced to eight years in prison last July.

Two prominent dissidents, Yuri Orlov and Anatoly Scharansky, remain behind bars.

The other four dissidents released yesterday are:

Mark Dymshits, a pilot sentenced to death by firing squad in 1970 for plotting with others to hijack a plane from Latvia to Swedan. His sentence was commuted to 15 years hard labor after widespread protests.

Edward Kuznetsov, a member of the "Union for Intellectual Freedom" who served a seven-year prison sentence in the 1960s on a charge of anti-Soviet agitation and propaganda. In 1970, he was sentenced to death along with Dymshits for his role in the same hijacking plot.His sentence was commuted to 15 years imprisonment.

Valentyn Moroz, a Ukrainian historian and publicist who has spent most of his life since 1965 in various prisons on anti-Soviet agitation and propaganda charges stemming from his writings.

Georgi Vins, a Baptist leader in the Ukrain and the son of a Baptist minister who died in a Soviet prison while serving his third prison term for missionary activity. First arrested and imprisoned in 1966, Vins was last sentenced in 1975 to five years in a labor camp and five years exile on charges of "defaming the Soviet state" and "infringing on the rights of citizens under the guise of performing religious ceremonies."

Enger and Chernyayev, the convicted spies who were returned to the Soviet Union last night, were considered international employes of the United Nations and did not have normal diplomatic immunity. FBI agents arrested them last May on charges that they paid $16,000 for secret Navy documents about submarines.

A few weeks later, in what was widely regarded as a Soviet response, Francis J. Crawford, an American businessman in Moscow, was arrested and charged with violations of Soviet currency laws. But the governments then worked out an unusual trade, in which Crawford and the two Russians were released to the custody of their own ambassadors.

Enger and Chernyayev were convicted last October and sentenced to a 50-year prison term, severe punishments that surprised some U.S. foreign policy officials. However, they were not jailed. Instead, at the request of the American government, they were confined to the area surrounding their Soviet residence in the Bronx in the custody of the Soviet ambassador.

Experts noted yesterday that the five men freed in Moscow represent a broad spectrum of dissident activity. Dymshits and Kuznetsov, for example, are Jewish activists, while Vins is a leader of the Baptist movement. Moroz is widely known to followers of the movement for Ukrainian independecne, and Ginzburg is an active member of the dissident intellectual community in Moscow.

Release of the five leaves Anatoly Scharansky and Yuri Orlov as the two most prominent Soviet dissidents still in prison. They and Ginzburg were all convicted last year in highly publicized trials that appeared to be a deliberate Moscow response to President Carter's human rights campaign.

Scharansky was sentenced to a 15-year prison term for espionage and Orlov to seven years in prison and five years internal exile for "slanderous concoctions, smearing the Soviet state and social order, with the object of weakening Soviet power."

Last year, the Carter administration unsuccessfully sought to trade Enger and Chernyayev for Scharansky and Orlov. It was clear from the comments of officials that Scharansky, at least, was suggested-again unsuccessfully-as part of the trade announced yesterday.

The Moscow dissident trials of last spring and summer marked a low point in the tense relationship between the Soviets and the Carter administration over the issue of human rights. Obviously sensitive to that relationship, the White House made no attempt yesterday to ballyhoo the exchange as a victory for Carter's human rights policy, and the president did not even appear personally to make the anouncement.

But American officials were clearly pleased that the exchange could be announced so close to the expected signing of a new strategic arms limitation treaty (SALT) with the Soviet Union and a summit conference between Carter and Soviet President Leonid I. Brezhnev. The Senate debate over approval of the treaty is bound to be deeply affected by the state of overall Soviet-American relations, including Soviet treatment of dissidents who have large U.S. followings.

"Our feeling is that this is very positive. It improves the atmosphere and creates a context, we hope, for working out other problems," an official said.

Describing the five dissidents as "genuine prisoners of conscience," the official said their release "is helpful" in the SALT negotiations and subsequent Senate debate, and in other aspects of Soviet-American relations.

The official also suggested that attempts will continue for the release of other Soviet dissidents.

The negotiations that led to yesterday's exchange began last fall, administration officials said. They were conducted by Zbigniew Brzezinki, the White House national security adviser, or his deputy, David Aaron, with Soviet Ambassador Anatoliy F. Dobrynin. The talks took place at the Soviet embassy, at Brzezinski's White House office and at his home in McLean.

The negotiations were concluded in the last few days and it was decided to make the exchange "simple," an official said. That, he said, led to the decision to use a regularly scheduled commercial airline flight and the hangar at Kennedy. The exchange took place in the presence of officials of the National Security Council, State Department and Justice Department. Alexander Ginzburg

Alexander Ginzburg, 43, who was sentenced to eight years in jail and five years internal exile last summer, was one of the leading human rights activists in the Soviet Union.

A friend of Nobel Prize-winning author Alexander Solzhenitsyn, Ginzburg administered a special fund established by the author to aid families of political prisoners. With other Moscow rights activists he established a Helsinki Watch Committee, in 1976 to monitor Soviet compliance with the human rights provisions of the 1975 Agreement on European Security and Cooperation. As a result of these activities he was convicted on charges on anti-Soviet agitation and propaganda.

An editor and journalist, Ginzburg was first arrested in 1960 for having edited three issues of the poetry magazine "Syntax," and spent two years in a labor camp.

In 1967, he was arrested and tried again after he compiled a White Book containing documents about a dissident trial. He was sentenced to five years at hard labor. Valentin Moroz

Valentin Moroz, 43, a leading Ukrainian nationalist intellectual and civil rights activist, is an historian by profession. He was first arrested in 1965 for possession of unauthorised literature and sentenced to four years in jail for "anti-Soviet agitation and propaganda."

In prison, he wrote "A Prison, he wrote "A Report from the Beria Reservation." After his release in 1969, Moroz wrote several critical essays and was arrested again in 1970 and sentenced to nine years' imprisonment and five years' internal exile.

After six years at the Vladimir Prison, Moroz was sent to the Serbsky Institute of Forensic Pyschiatry in Moscow, a move viewed by his friends as a prelude to indefinite confinement in the asylum. After widespread protests in the West, Moroz was judged to be sane and in 1976 was transferred to a prison camp in Mordovia.

Moroz's essays include "A Chronicle of Resistance," "Amid the Snows" and "Moses and Dathan." He has become a leading symbol of the Ukrainian movement for national and civil rights. Georgi Vins

Georgi Vins, 51, a prominent Baptist leader in the Ukraine, was arrested in 1974 for conducting an underground ministery. He was convicted and sentenced to five years in prison and five years' internal exile, with confiscation of property.

The charge was "defaming the Soviet state" and "infringing on the rights of citizens under the guise of performing religious ceremonies."

Vins is the son of a Baptist minister who died in a Sovet prison while serving his third term for missionary activity. Vins' mother was also imprisoned for religious activities.

Vis served an earlier three-year term after he was arrested in 1966. The charges of violating laws on the separation of church and state stemmed from his leadership in a grass-roots movement among Soviet Baptists. It broke away from the officially sanctioned All-Union Coucil of Evangelical Christians and Baptists to form its own organization known as the Initative Baptists. Mark Dymshits

Mark Dymshits, 52, a Jewish activist from Leningrad, is a professional pilot. He never formally applied to emigrate, but secretly decided to go to Israel and worked out a plan with 10 other Soviet Jews to hijack a plane from Riga to Sweden in 1970.

Dymshits and the others were arrested on June 15, 1970. He and another key organizer, Eduard Kuznetsov, were charge with treason in a Leningrad court and sentenced to death by firing squad. Nine other codefendants received prison terms. After a worldwide outcry agianst the death sentences for offenses that were never actually carried out, the Supreme Court of the Russian Federation commuted them a 15-year prison terms.

Once a Communist Party member, Dymshits said he decided to go to Israel because of "anti-Semitism in the Soviet Union." He said he had wanted to build an airplane but realized he would not be able to do it himself and so started to search for helpers.

His wife and two daughters were arrested at the Leningrad airport but were later released. Eduard Kuznetsov

"The only thing that has driven me to do this," Eduard Kuznetsov said on trial in Leningrad for his part in a plot to hijack a plane to Sweden, "was my desire to live and work in Israel, my spiritual fatherland. This desire has become a chief objective of my life."

Along with Mark Dymshits, Kuznetsov was sentenced to death in December 1970, but the penalty was later reduced to 15 years in prison. At the time of his arrest at the Leningrad airport, Kuznetsov had a pistol.

Born in 1939, Kuznetsov become active in Jewish affairs in Leningrad in the early 1960s.He also joined the Union for Intellectual Freedom, a clandestine Marxist group advocating greater cultural freedom. That membership led to his arrest and trial on charge of "anti-Soviet agitation and propaganda."

He served a seven-year sentence ending in 1968. His wife, Silva Zalmanson, was also arrested and tired fo participating in the hijacking plot.

Kuznetsov's "Prison Diaries" were smuggled out of the Mordovian camp, where he served his term, and published in several Western countries. CAPTION: Picture 1, Alexander Ginzburg . . . one of dissidents released; Picture 2, RUDOLF CHERNYAYEV; Picture 3, VALDIK ENGER . . . former U.N. employes faced 50-year prison terms after U.S. conviction as spies; Picture 4, no caption, AP