As the mental health of Peoples Temple church leader Jim Jones deteriorated rapidly over the past year, his Jonestown agricultural commune in Guyana became a nightmarish concentration camp.

Its 800 to 1,000 residents were kept prisoners by heavily armed guards and threats of death. For those caught attempting to escape, there was solitary confinement in a three-foot-high "punishment box," forced work on a chain gang in the tropical sun, and heavy sedation in a special drug unit.

By day Jim Jones tried to keep up the apparence of utopia, calling his shotgun-carrying security force the "learning crew" and, later, the "public service unit." He called the medical facility where troublemakers were sedated the "extra care unit."

By night he forced Jonestown's residents gathered in mass meetings to endure hours-long harangues about distant enemies, invasion threats, retaliatory assassinations and mass suicide.

Once or twice a month, suicide drills were held in which everyone, surrounded by armed guards, had to drink from cups of fake poison.

This was the picture of Jonestown's final months drawn today by one of its survivors, 17-year-old Tom Bogue, who succeeded in leaving Jonestown with the fact-finding mission of Rep. Leo J. Ryan (D-Calif.) last Saturday only to be ambushed with the congressman and 30 others at a nearby landing strip.

Bogue was shot in the leg as he tried to hide in one of the two planes the group was about to board. He then led his sister and three other young Jonestown defectors into hiding in the dense rain forest, where they wandered for three days without food, drinking swamp water, until they reached safety back near the Port Kaitums landing strip.

He and his sister, who also was wounded by the gunfire that killed Rep. Ryan and four others at the air strip, are now under military guard at the sprawling, mostly open-air public hospital here.

In an interview today at the hospital, where he was sitting up in bed, his left leg bandaged and badly scratched, Bogue described how life in Jonestown progressed from an enticing experiment to apocalypse, culminating in Saturday night's forced mass suicide that took the lives of more than 400 Americans.

Bogue said that when he first came to Jonestown from California with other members of his family 2 1/2 years ago, it was a pleasant place where "everyone had lots of freedom." But then, just about a year ago, Bogue said, Jim Jones began "acting crazy."

"Everybody had to be in bed by 11 o'clock and then everybody had to be up by 7 in the morning," he said. "We had to go to meetings every night," and two or three times each week those meetings dragged on late into the night as a raving Rev. Jones held force over the loud speaker in the commune's open air pavilion.

Jones would begin by exhorting the residents to work harder at farming and animal raising, Bogue remembered, and then would move to talking about the threat that critics back in the United States posed for Jonestown.

"He said we had to protect ourselves against invaders," Bogue said, and residents of Jonestown were shown at least 100 guns that had been brought there. "Guyana had cleared us to have all those guns, but 'Still don't show your weapons,'" Bogue quoted Jones as saying.

One night, "Jones told everyone in the pavilion, 'Quiet, and you'll hear one of our new weapons.' Then we heard this big boom, like a bazooka." Bogue said he was never able to see this new weapon.

On other nights, Jones told the assembly he wanted to send gunmen from Jonestown to kill his enemies in the United States but then he might be blamed for the murders and arrested as an accessory to the crimes.

As things grew worse, Bogue said, he asked rain forest Indians, who traded in Jonestown, to teach him ways to live in the forest. The Jonestown escapee said he learned from them how to eat and drink in the forest, how to hide from pursuers, and how to keep from getting lost.

He said he was certain that other disaffected young people in Jonestown also were plotting to escape but they never discussed such plans with each other because each never knew whom he could trust.

Finally, months ago, Bogue slipped off into the forest but made the mistake of returning to the public road on the way to the Guyana military outpost at Matthews Ridge, 20 miles from Jonestown. There he was caught by Jonestown security guards who were searching for him on tractors. He was returned to Jonestown with the barrel of a shotgun held against his back during the entire journey; he said.

As punishment, Bogue and a friend who also was caught escaping were shackled in chains for three weeks and forced to work in the shackles 18 hours each day chopping wood in the tropical heat.

Others who tried to escape, Bogue said, were placed in solitary confinement in a box six feet long, three feet wide and only three feet high. Each person was usually confined in the dark, hot box for a week at a time and was fed and checked by the Jonestown medical team once a day, according to Bogue.

He said one "punishment box" was in a big storage trench and the other was in a storage tent on a hill at the edge of the settlement.

Still other troublemakers were forced to dig deep storage pits and 200-foot-long ditches. "Those who didn't work," Bogue said, "didn't eat."

Bogue said that five or six people he knew were sedated for two or three days each with the drug thorazine in the "extra care unit" - which was the ultimate solution "for people who supposedly were lunatics, people who wanted to go back" to the United States.

Bogue said many Jonestown residents could sense toward the end of Ryan's visit there last weekend that the atmosphere had grown more tense than ever. Jones became quite agitated and kept talking about death.

At least five younger Jonestown residents whom Bogue knew slipped out of the commune Saturday morning and later made their way to safety. Bogue, his sister Tina, 22 Chris O'Neill, 20, and Brenda and Tracy parks, 18 and 13, respectively, joined about 10 others who decided to leave Jonestown with Rep. Ryan late Saturday afternoon.

Bogue was already inside one of the two planes on the landing strip when Ryan's group was ambushed by six gunmen Bogue recognized from Jonestown. He said they fired rifles, shotguns and automatic weapons. He was hit in the leg when he tried to close the plane door.

When he heard people shouting that the gunmen might come back and finish them off, Bogue said, he took his sister, the Parks sisters and O'Neill and fled into the forest. Because they kept hearing what they thought were people chasing them, Bogue said he used the tricks the Indians had taught him, leading the others in big circles and crossbacks through the forest and walking into rivers to break their trail.

As that night stretched into another day and another day after that, Bogue and his sister were slowed by their wounds. He finally sent the other three on ahead and they found the landing strip again.

There the Parks sisters spotted their father, Tom Parks, another Jonestown defector who had returned with the police to search for his daughters and help identify the dead in Jonestown.

As the Parks sisters were reunited with their father, the police followed their directions and rescued Bogue and his sister. CAPTION: Picture 1, Jim Jones, . . . described as "acting crazy", Copyright (c) 1976, The San Francisco Examiner; Picture 2, Tame parrot perches on a fence around the Jonestown cult compound containing bodies of suicide victims. Copyright (c) 1978, The San Francisco Examiner