Scenes of pillage and destruction are all that remain in this city's slums, where for three weeks Sandinista rebels withstood savage bombardment.

The smell of corpses and rotting garbage permeated the air as residents began to reclaim what remains of their homes from the packs of dogs and swarms of insects that had taken them over from fleeing rebels.

The guerrillas, who stage a "strategic retreat" from the shantytowns Wednesday and Thursday nights, left behind dozens of barricades and makeshift bomb shelters in which they had sought refuge from the intense bombardment by President Anatasia Somoza's National Guard.

In several of the shelters, arms and legs protruded from the thin layers of earth hastily shoveled on top of bodies.

Some of the shelters were large enough to hold several dozen people, and residents who remained through the bombing said the guerrillas spent much of the 21 days they held the area inside them.

Hulks of burned-out automobiles rested at the bottom of many of the half-dug trenches, pushed into the holdes by rebels seeking protection from the rockets, bombs, mortars and even 55-gallon gasoline drums with incendiary triggers that had rained down on them almost ceaselessly. Neighbors pointed out one shelter that they said had suffered a direct rocket hit with the instant loss of 12 lives.

"The kids posted about a third of their number around the borders of the neighborhood," said a 63-year-old woman who, alone among the nine members of her family, chose to remain in her home, instead of fleeing with them two weeks ago.

"Those were the kids who held the barricades and set up sniper posts to keep the guardsmen out.

"The rest of them had nothing to do but hide and shoot their little pistols and rifles at the planes." The rebels there had no antiaircraft weapons.

Only one of the woman's elderly neighbors chose to remain with her on the little dirt road in the slum of Bello Horizonte.

"Both of us are old. Neither of us cares for politics. But we preferred to die here with these brave boys than to fee and die next year in bed," she said.

"My neighbor was crushed in her bed when a bomb destroyed her house. I buried her myself."

During the period of heaviest bombing, small Cessna planes and National Guard helicopters flew over the slums of eastern Managua every day, aiming their deadly cargo as best they could at neighborhoods controlled by the ragged rebel force.

Today, guardsmen moved cautiously though the streets of Bello Norizonte, holding theri light Uzi sub-machine guns in fear of any rebels who might remain. Cars leaving the area were carefully searched, and occasional burst of gunfire seemed to confirm reports that some rebels are still hiding in the area.

The entering soldiers found disease and misery, but very few rebels. Almost all of them - a total of 5,000 according to the claims of the clandestine Radio Sandino - crept out of their positions during the last 48 hours to regroup outside the city.

A 7-year-old girl led the way to a mound of dirt behind a row of shacks that had miraculously escaped damage. Last week, she said, rebels buried 17 of their number there.

A neighbor said she had attended the funeral service conducted by the guerrillas for their comrades and point to the letters "CCFA" painted on a fence behind the burial mound. The letters, she explained, stand for "Carlos Fonseca Amador Cemetery," in honor of a founder of the guerrilla movement who was killed in 1976.

Rebel slogans, painted on every wall, said "War Until Victory," "Somoza Murderer" "Guardsmen, Stop Killing Your Brothers."

Beside Lake Managua, 500 yards from the National Palace in the center of the city, the bodies of eight blindfolded young rebels, their hands tied behind their backs and some of them still wearing the red and black kerchiefs of the Sandinista movement, lay under the tropical sun.

In the slum of San Judas, scene of intense fighting and many deaths, 10 boys who had been arrested by guardsmen were found tortured to death by electric shocks administered to their chests, genitals and eyes.

Stories of torture and dismemberment were told by missionaries and other residents of the poor areas where fithing was heavy. More bodies are discovered daily, often on the floors of homes belonging to returning residents.

Some of the craters left by 500-pound bombs dropped on Bello Horizonte have already become playing grounds for emaciated children.

In one hole, perhaps 15 feet across and 10 feet deep, a young girl climbed on the top of a gutted car until her distraught mother found her and, with a mixture of anger and relief, ordered her to climb out.

"I never thought this could happen," said a lawyer, surveying the remains of the neighborhood around his office. Obviously dazed, he could only repeat, "I don't know. I don't know what to say I don't know what to do. I don't even know where to start." CAPTION: Picture, Two young Nicaraguan girls push a cart through debris on Managua's slums. AP