Three rival armies of differing strengths and the first peace-keeping force formed by the Organization of African Unity are tensely poised near a village in central Chad as a fragile truce in Africa's longest running war threatens to collapse.

The OAU force, formed late last year to keep peace after the withdrawal of 7,000 Libyan troops, was able last month to halt renewed fighting by two armies in the complex, many-sided civil war, but it is now confronted by the powerful force of rebel leader Hissene Habre, which had taken refuge in neighboring Sudan during the year-long Libyan occupation.

Habre, who was pushed into Sudan by the Libyans, has halted near the central Chadian village of Ati, 250 miles east of Ndjamena, the capital, and has avoided clashing with the three-nation OAU force, made up of 3,800 soldiers from Nigeria, Zaire and Senegal.

But before halting short of the OAU force, Habre's 4,000 troops mauled the combined, but usually rival, forces of Chadian President Goukouni Oueddei's national Army and Chadian Foreign Minister Ahmat Acyl's Libyan-trained troops. The remnants of both Goukouni's and Acyl's war-weary forces are now behind the OAU peace-keeping force's lines at Ati.

In a spectacular six-week drive, Habre's forces had pushed out of their refuges along the Sudanese border into eastern Chad as the Libyan forces were withdrawing and occupied a third of the country while driving toward Ndjamena.

The OAU commander, Nigerian Maj. Gen. Geoffrey Ejiga, has said he will "not tolerate any effort to bypass" his troops at Ati, according to one Western source. Informed officials here interpret Ejiga's remarks as a warning to Habre not to try to outflank the OAU in an attempt to attack Ndjamena.

"There is no doubt that Habre would be at Ndjamena today if it weren't for the OAU forces at Ati," said one diplomatic source.

Libya's military occupation of Chad, which ended in November, brought a peace of sorts but did not prompt any movement toward a lasting reconciliation among the country's many rival factions.

Allegations linking Libya to the Dec. 31 coup in Ghana have heightened OAU concerns about preventing Libya's soldiers from returning to Chad, according to a highly placed official source. Libyan leader Muammar Qaddafi has made territorial claims on swaths of Chad, uranium-rich Niger and Algeria.

While the standoff persists, life in Ndjamena, the site of heavy fighting before the Libyan occupation, has sprung back to almost normal with major technical and financial aid from France. Running water has been restored for most of the day, and electricity and telecommunications have been repaired.

About 60,000 of the 100,000 Chadians who fled during the height of the fighting into Cameroon have returned. Those still there "are Habre sympathizers or families who are waiting to see what Habre does next," said one refugee official.

Schools have not reopened but the crowds on both banks of the Chari River--the border with Cameroon-- and the many pirogues ferrying food from Kousseri, Cameroon, to Ndjamena give an atmosphere of a return to normal. The city's central market is crowded with shoppers from dawn to dusk, and foodstuffs are at abundant, prewar levels. There is a midnight-to-5 a.m. curfew.

Several score of raw recruits for Goukouni's Army were drilling in the central square this morning next to the city's bullet-scarred cathedral.

Most of the buildings of downtown Ndjamena still carry scars of the fierce gun battles here in 1980. One exception is the fully restored white-with-turquoise-trim Libyan Embassy next to the bullet-holed facade of the abandoned U.S. Embassy. The United States is reopening its embassy today at the ambassador's residence, far from any likely fights for control of central Ndjamena. According to a Chadian caretaker, the Libyan Embassy has been empty since the Libyans withdrew.

By replacing the Libyans with its first peace-keeping force, the OAU hopes to establish a basis for a political reconciliation, not only between Goukouni's weak coalition government and Habre, but also among the often contentious forces within the coalition government.

Five of Chad's 10 Moslem factions have armies of 3,000 to 4,000 men, differentiated from each other by the political ambitions of their leaders and ethnic, regional and family ties. They are united only by their antipathy to Habre.

Last year, Goukouni's forces and those of Interior Minister Mahamat Abba Said separately had bloody territorial fights with Acyl's troops. Both times the Libyans interceded on Acyl's behalf, diplomatic sources said--an action that partially led to Goukouni's request that they leave.

Habre, who clearly has the best army of all the factions, has said he is willing to hold talks, but Goukouni repeatedly has said that under no circumstances would he negotiate a settlement with Habre.

Chad's civil war broke out about five years after independence from France in 1960 when northern Moslems--about half of the estimated 4 million population--rebelled against the heavy-handed government of the southern black Christians and animists. After 14 years of war, in which France figured prominently on the side of the blacks, the Moslems won during violent street fighting for Ndjamena in early 1979.

As Moslems jockeyed for power, fighting broke out in 1980 with nine factions plus the blacks lined up against Habre. Habre's force held its own until Libya, at Goukouni's invitation, intervened with tanks.

Both the strongly anti-Qaddafi governments of Sudan and Egypt had been aiding Habre openly until a reconciliation with Goukouni's government last week.