In a compromise move that strengthens President Carter's campaign to keep Congress from lifting economic sanctions against Zimbabwe-Rhodesia, the House Foreign Affairs Committee approved unanimously yesterday a bill that would give Carter the right to keep sanctions in force to protect U.S. national interests.

The committee voted, 26 to 0, to send to the House floor next week a proposal that world require the president to lift sanctions by Oct. 15 unless he certified to Congress that ending the trade embargo would damage national interests.

A sharp challenge is likely to be mounted on the floor by conservatives who want to lift sanctions immediately. But committee liberals and conservatives who voted for the bill, and administration officials who backed it, predicated that the legislation would pass and would stalemate Senate efforts to end the embargo against Carter's will.

Carter said a week ago that litting sanctions would harm U.S. interests abroad because "genuine majority rule" has not yet been achieved in the breakaway British colony. The Senate voted, 52 to 41, earlier this week to ignore Carter's decision and keep a sanctions-lifting amendment in the Defense Department authorization bill.

The principal architects of the compromise were Rep. Stephen J. Solarz, a liberal Democrat from New York who generally supports the administration's policies on Africa, and Rep, Paul Findley (R. Ill.), who would like to see sanctions lifted immediately but who committed himself yesterday to defending the committee bill against any amendment.

"I am not sure the votes are there in the House to lift sanctions, and the votes probably don't exist in either the House or Senate to override a presidential veto," Findley said after the vote. "We have given the president a loophole, and we hope that he will use it with great care and concern."

The continuing controversy over legislating a unilateral end to U.S. participation in the British-led international economic embargo was triggered by 1978 legislation that required Carter to lift sanctions if a new government inZimbabwe-Rhodesia met two conditions.

Those conditions were the holding of free and fair elections, and a genuine effort to negotiate an end to the guerrilla war being led by the forces of the Patriotic Front. Carter decided Thursday that the new government headed by Bishop Abel Muzorewa, the country's first black prime minister, fell short on both counts.

But the president went beyond those legalistic grounds to stress the national interest aspects of maintaining good economic and diplomatic ties with black Africa and, by inference, preventing the Soviet Union from explotting anti-American sentiments that lifting sanctions would bring in the Third World.

Although administration officials were unhappy with the Oct. 15 date, they were pleased that the bill echoed Carter's national interests approach.

Findley and Solarz suggested in seperate conversations after the vote that the October date had been chosen with an eye to the possible lifting of sanctions by the new Tory government in Britain. The Tories are expected to try to keep sanctions on until after the Commonwealth meeting in Lusaka, Zambia, later this summer, but pressures to lift them will grow after that.

"Our action could be an incentive to the British to act more promptly" than Oct. 15, Findley said. "That would significantly change the situation."

The bill also echoes the qualified praise that Carter and Secretary of State Cyrus R. Vance voiced last week for what they saw as the relative freedom of the April elections. The House bill calls the elections "a significant step toward multiracial democracy" in the country of 200,000 whites and 7.5 million blacks.

But Carter said that the country's constitution, which was approved by whites only and which can be amended only with white political cooperation, relegated blacks to secondclass citizenship by keeping the army, police, civil service and other key government agencies in white hands for the foreseeable future.

The House bill "represents an enormous compromise on all sides," Solarz said. "Nobody is happy with all of it, including myself.But this transforms the political situation in the House. We are giving the president an opportunity to react to the changes that are going to take place on the ground."

Asked what circumstances would justify the lifting of sanctions, Solarz listed the achievement of an agreement between the guerrillas and Muzorewa's government, the lifting of sanctions by the British or moves by Muzorewa to assume "the substance, not the trappings, of power" from his white political partners.

Assistant Secretary of State Douglas J. Bennet called the resolution "the finest achievement by any committee that I have witnessed since I've been congressional liason officer for the administration. These guys are a bunch of statesmen."