Before ever launching Skylab, the National Aeronautics and Space Administration faced a dilemma: should it endanger the astronauts who would use the space station or the people living under its meandering orbit - 90 percent of the world's population?

NASA officials decided to safeguard the space explorers. Yesterday that gamble paid off when 26 tons of metal debris - the remains of history's largest spacecraft - missed the populated areas of the world, and fell mostly into the sea.

Hey might, of course, have hit almost anywhere on Earth, from 50 degrees north latitude to 50 degrees south. NASA in 1970 and 1971 looked at the odds that Skylab would hurt people or property and decided that they constituted an acceptable risk." On behalf of the planet, NASA accepted it.

"The conclusion was that the risk was of the same order of magnitude as that from other orbital debris," George M. Low, who as deputy head on NASA reviewed and approved risk figures in 1971, recalled recently.

The question was whether to outfit the Skylab orbital workshop with a retrorocket system that could bring the 157,000-pound space station down safely in a "controlled deorbit." But the installation would cost money, use up precious payload weight, and risk an explosion that might harm the crew.

Balancing this risk against the seemingly remote likelihood of injury to people below, NASA decided to let the spacecraft make a "random deorbit." Yesterday, it did just that - with a little nudging and adjustment by controllers on the ground. NASA had won its gamble. More important, sohad the people under Skylab's looping ground track.

But before that last card was dealt, NASA, like a nervous casino bettor, tried to hedge its bets, launching an ill-fated multimillion-dollar effort to reach the crippled station and boost it higher, or ride it down.

In its 15-month history, the rescue effort ran into technical and financial problems and a very unfavorable run of cosmic weather. Last December, the space agency abandoned it - insisting that it had been unnecessary all along.

The rescue program was "done more as a feeling of we are going to be responsible even if there is a low probability" of injury or damage, Robert A. Frosch, NASA's current administrator, said in an interview.

The anticlimax of Skylab's re-entry was, in a way, characteristic of its troubled career. It was born in adversity, survived to function successfully for eight months, and then ran into unexpected difficulties after its last crew left.

Within minutes of its launch in May 1973, one solar power "wing" broke off, and the other became snarled. Skylab's meteorite shield broke. The first crew of astronauts had to don space suits and go outside to put things right.

But after its shaky beginning, Skylab functioned better than expected, and three successive crew remained aboard a total of 171 days.

After the last crew left on Feb. 8, 1974, however, ground control put Skylab into a stable attitude and forgot about it, estimating it would remain in orbit until 1983.

Back on Earth, the Space Shuttle program was gearing up. Shuttle flights, it was predicted, would be routine by the '80s. "when the shuttle plan was laid out, we began to say, 'Here's a thing we can do,'" recalled William C. Schneider, who headed the Skylab mission. "I cannot say that at the time we launched we had definite plans to go up and revisit."

But in 1976 a new sunspot cycle began. The life and death of all Earth satellites depends on the sun. Increased solar activity makes the atmosphere expand, creating "drag." As drag increases, the satellite comes closer to Earth until it tumbles out of orbit altogether.

Forecasting solar activity is chancy and NASA's prediction of sunspot activity was dead wrong; 1976 saw the sun unleash the first blasts of a violent upswing. Skylab's life expectancy shrank, and a new NASA administration began a crash effort: A tiny, remote-controlled rocket unit would dock with the workshop and push it either up into a stable orbit or down into an ocean.

But this scheme depended on the space shuttle to carry the rocket and its human operator into space. And the shuttle program, beset with budget cuts and technical problems, was falling farther and farther behind schedule.

By Christmas 1978, Frosch concluded there was only a 10 percent chance of saving Skylab. Risks and benefits were balanced again, using a new study of risks to those living below if the space station fell.

According to that study, there was one chance in 40 that such a fragment would weigh 250 pounds or more. The odds against a single human casualty, the study said, were 151 to one.

Forsch recommended to President Carter that the rocket rescue plan he dropped.

Since January NASA has been enduring the ridicule of millions who once held the space program in awe. But Skylab performed like a trouper at the end.

In March 1978, a team of NASA engineers flew to a tracking station in Bermuda to try to communicate with Skylab. To their delighted surprise, they found they could turn it on, reprogram the onboard computers, and put it through complicated maneuvers in orbit.

This control left Skylab's handlers feeling that they were losing, not a hunk of used-up junk, but a living vehicle which had become, for some of them, a friend.

"It's been a very forgiving vehicle," mused Herman Thomason, who headed the Skylab reactivation task force. "We've madesome stupid mistakes and it's helped us get back." CAPTION: Map, Skylab's Descent, By Dave Cook - The Washington Post