The Democratic-controlled House yesterday told President Reagan that he cannot send U.S. combat troops to Nicaragua without prior congressional approval but provided a list of loopholes.

The troops ban was approved, 312 to 111, as an amendment to the $292.6 billion defense authorization bill for next year. Nearly half of the House Republicans, some conservative Democrats and many liberal Democrats opposed the ban.

Supporters said the vote sent the White House a strong signal that the House would not back U.S. military intervention in Nicaragua. But many liberals said they viewed it as a major step backward because of the exceptions.

"The House of Representatives is saying, 'Go to war, Mr. President,' " Rep. Don Edwards (D-Calif.) said. "It's worse than nothing. It really tells him what he can do."

The House approved a similar prohibition last year, but with fewer exceptions. That measure was eventually changed into a nonbinding resolution in a conference with the Republican-led Senate, which has approved no such prohibition.

Proposed by the GOP in an effort to water down or kill the ban, the exceptions would allow Reagan to dispatch troops without prior congressional approval if U.S. citizens, possessions or allies were threatened by attack, if Nicaragua began importing Soviet-made MiG jet fighters or nuclear weapons, or U.S. citizens or allies were hijacked, kidnaped or otherwise terrorized.

The House defeated a GOP amendment that would have let Reagan to send combat troops if he found that Nicaragua "directly or indirectly" supported terrorist or guerrilla actions against El Salvador, Honduras or Costa Rica.

Republicans and conservative Democrats said that, despite the waivers, the ban would hamstring the president. Under the Constitution, he is commander-in-chief, and under the War Powers Act, he can send troops anywhere without congressional approval for 90 days.

The House adopted several other amendments before voting final approval of the fiscal 1986 defense bill last night, 278 to 106. The measure freezes the defense budget at the fiscal 1985 level.

The Senate has approved a $302.5 billion defense measure, which provides about a 3 percent increase for inflation. Differences must be worked out in conference after the Fourth of July recess that begins today and ends July 8.

Yesterday's action came a month after the House reversed itself and agreed to renew aid to counterrevolutionaries, or contras, fighting the leftist Nicaraguan government.

During an often emotional four-hour debate, in which many lawmakers recalled the thousands of U.S. military deaths in Vietnam, Rep. Thomas S. Foley (D-Wash.) argued that the ban's "purpose is to put this House firmly on record" against U.S. military involvement. He said it "does nothing more than underscore the stated policy of this administration."

Rep. Edward J. Markey (D-Mass.) said, "What we're saying to the president is, 'Before you start charging up San Juan Hill, how about stopping on Capitol Hill first?' "

But Rep. Henry J. Hyde (R-Ill.) called the ban a "raw political statement designed to cripple and embarrass the president at a particularly crucial time when we are under siege around the world by state-sponsored terrorism."

Rep. Duncan L. Hunter (R-Calif.), sponsor of two of the watering-down amendments, said, "They're trampling the American flag in Beirut. They're killing American Marines in El Salvador, and what to we say to our president? We say, 'We don't trust you.' "

In other action, the House rejected amendments that would have barred a raise for military personnel unless federal civilian employes were simultaneously given the same percentage increase, and cut funds for developing 155 mm nuclear artillery shells, designed for use by the North Atlantic Treaty Organization.