President Carter was preoccupied with the natural gas compromise yesterday, but that was far from the only problem confronting him as he resumed work in the White House after a 12-day vacation.

Facing Carter in the next several weeks, in the words of one White House official, is a series of "very critical" tests that presidential aides hope will mark the beginning of a political upturn for the president.

The most important of these are the gas-pricing legislation and the Middle East summit conference at Camp David, which will dominate Carter's agenda most of next week.

But Congress also returns next week for a round of legislative skirmishes that will help determine the president's domestic record for his nearly two years in office.

With Congress planning to adjourn in early October, there is little time left to consider the items on Carter's agenda.

Major administration goals, including Civil Service revision, urban policy, airline deregulation and hospital cost containment, have uncertain fates in the closing weeks of Congress.

In addition, the White House will be fighting to sustain Carter's veto of $36 billion weapons procurement authorization bill, to head off tuition tax credit and public works appropriations measures he has also threatened to veto and to reach a compromise on the capital gains tax issue in the pending tax cut legislation.

Much is at stake for Carter in these matters as he and his aides battle to overcome the image of ineffectiveness that has grown up around him during his first 19 months in office.

It was not surprising that the president first turned his attention yesterday to the natural gas compromise, which began to unravel while he vacationed in the tranquility of the Rocky Mountains. Of all the domestic issues facing him, none is more critical to his political future or better illustrates the evolution of lowered expectations that has occured in the White House.

It was one year ago next month that presidential aides began an all-out drive for passage of Carter's national energy legislation, conceding then that the president needed "one big victory," preferably on energy, to make his first year in offie sucessful.

At the time, the natural gas legislation, which would raise prices to encourage conservation and exploration, was one part of the policy. Now it is virtually the whole ball game. The other key component of the president's original proposal - a tax on oil production that would also raise prices - appears buried for this year in Congress.

White House officials say the next few weeks could be the "make or break" time on the gas deregulation issue for years to come, and they speak of making an all-out effort to gain passage of a bill, almost without regard to what is in it.

Carter once promised the governors of three gas-producing states that he would support price deregulation, and two of the , Dolph Briscoe of Texas and David Boren of Oklahoma, were back at the White House yesterday for another sales pitch.

The bill Carter is trying to save would deregulate gas prices over a period of years. It pleases neither producers nor consumers, threatening the fragile compromise that has been put together on the issue.

If the president found any comfort upon his return to Washington, it may have been the mood of his staff, which continued to work while he enjoyed the Salmon River and the Tetons. No one is predicting a sudden resurgence in Carter's popularity, but senior advisers are looking for a gradual upturn in the polls beginning soon.

Aides speak confidently of sustaining the defense veto and passing the Civil Service legislation. They are less certain about the other issues, but they contend that the Carter White House is finally functioning in a cohesive well-ordered manner.

"Nothing is done on a piecemeal, ad hoc basis anymore," one official said. "We can't afford to be sloppy anymore."

Tr for add six

While the president has been out of town, his media adviser, Gerald Rafshoon, has been hard at work trying to identify the major themes of the Carter administration. He has come up with what is known in the White House as "the three E's - Energy, Economy and Efficiency.

The coming Rafshoon-directed sales pitch will say that Carter is moving boldly to gain control of three difficult national problems - energy, the economy (meaning chiefly inflation) and the government bureaucracy.

As one presidential aide noted, two of the Es - in the form of the natural gas and Civil Service legislation - are nearing decision points on Capitol Hill. And no public relations campaign, however artful, can substitute for real accomplishments.

Tr for add seven

"There is a tremendous opportunity for us," the official said. "If these things break our way, the president will be vindicated in what he's been saying - that we are in the middle of a lot of different issues but we are making progress. I think people would say, yes that's right.

"If they all break the wrong way, I wouldn't want to say it's the end of the line, but there's no question it would set us back and make things all the more difficult . . . then it might be time to go back to the Salmon River."