President Carter knew nearly two months ago that his nominee for deputy treasury secretary, Kenneth Axelson, had a potential tax problem that might prevent his confirmation, a Treasury source said yesterday.

A grand jury investigation has not produced any evidence of wrongdoing by Axelson, the Justice Department said.

Axelson, on leave as senior vice president of the J.C. Penney Co., asked Wednesday that his name be withdrawn. Earlier, the Treasury had delayed sending his nomination to Capitol Hill pending completion of the grand jury probe into alleged kickback schemes inside the Penney firm.

The situation came to a head early this week when the Justice Department advised Carter and Treasury Secretary W. Michael Blumenthal that it would be unable to complete an investigation of Axelson's potential involvement in kickbacks for at least another month.

Associate Attorney General Michael J. Egan stressed in an interview yesterday that the department has "a real problem in our fear of casting blame on Axelson."

"What's happening is that there is a complicated, ongoing investigation, and the Justice Department is simply not prepared to say at this point whether he did anything wrong or not," Egan said.

Exelson, according to White House and Treasury sources, had told Treasury Secretary W. Michael Blumenthal, when first approached about the Treasury assignment early in January, about paying a Penney company contractor a nominal sum for a costly remodeling jon in his Manhattan apartment.

Blumenthal relayed this information to the President, but Carter and Blumenthal were so anxious to obtain Axelson's services that they decided to go ahead with the nomination White House and Treasury officials said.

Initially, Axelson allegedly paid less that one-sixth of the appraised value of the remodeling. Axelson is said to have told Blumenthal that when he was first billed he paid the check routinely, without even looking. "But that strains credulity," another government official said yesterday.

According to a Treasury source, Blumenthal checked with First National City Bank of New York President Walter Wriston, chairman of an independent audit committee engaged by Penney. Wriston said that at worst Axelson had been naive but had not acted improperly," the source said.

He added that presidential assistant Hamilton Jordon told Blumenthal on Jan. 13 that Axelson might have a tax problem. Blumenthal asked the Internal Revenue Service to check.

On Jan. 25 IRS Commmissioner Donald C. Alexander confirmed to Blumenthal that Axelson had a potential tax problem, the source said. Alexander reported that a federal grand jury in Brooklyn might link Axelson with a broad kickback scheme at the Penney Co. It was the first that Blumenthal had heard of a grand jury investigation involving Axelson, the source added.

The tax problem for Axelson would arise if IRS concluded that the value of any underpayment for the remodeling of Axelson's apartment was in reality income on which he owned federal taxes. In addition, Alexander reported to Blumenthal that Axelson might be charged with accepting other kickback money, the Treasury official said.

In addition to the prospective delay cited by the Justice Department, there was a sense of growing unease that, although no evidence of criminal wrongdoing on Axelson's part had been produced, his involvement with the contractor raised questions of ethical conduct that might reflect on the Carter administration.

Another factor was the imminent publication of an article by The New York Times rasing questions about Axelson and his relationships with the Penney company. Carter and Blumenthal decided at a midday meeting Wednesday to accept Axelson's withdrawal. The Times article appeared yesterday.

Egan gave this account of the Justice Department's involvement:

Because Blumenthal was anxious to have Axelson cleared and able to take up his duties at Treasury as quickly as possible. Attorney General Griffin B. Bell personally followed the progress of the clearance investigation.

"Blumenthal inquired about how long it would be before we reached the point where we would know if Axelson was in the clear," Egan said. "The problem was that we had information that there would be some question about him as long as the grand jury was sitting in Brooklyn."

Axelson testified before the grand jury on Feb. 23, Egan revealed, and afterward, the U.S. attorney in Brooklyn, David G. Trager, was instructed to obtain from judge Jacob Mishler, chief of the U.S. District Court there, a special order permitting the Justice Department to reveal Axelson's testimony ot Carter.

In the letter withdrawing his nomination to the post of deputy secretary - the No. 2 job in the Treasury Department, with wide sway over domestic and foreign economic affairs - Axelson said that he had been exonerated by both federal and company investigations.

His reason for withdrawing, hesaid, was that he would inevitably have "to give time and attention to answering questions and explaining my own exoneration. I do not believe this distraction will serve the Treasury's business or permit me to work with full effectiveness."

But Blumenthal's immediate acceptance of Axelson's withdrawal pointedly did not refer to an exoneration. The Treasury Secretary expressed only regrets, testifying, however to Axelson's "integrity."

Treasury officials yesterday confirmed that Blumenthal's letter was carefully drafted to avoid a committment at this point of the question of "exoneration."

A Treasury official denied some allegations in The New York Times story, including the suggestion that Blumenthal had withheld from other government officials information disclosed to him by Axelson.

White House officials argued that they were following the rule of "innocent until proven guilty," and that they had pursued the investigation prior to sending Axelson's name to Congress.

Egan said the court order had been obtained "out of an excess of caution. Axelson's testimony was substantially the same as what he had revealed previously to us, and it didn't shed any new light on the questions we had to answer."

Bell met with Trager earlier this week and was told by the U.S. attorney that it would be at least a month and possibly longer" before the grand jury probe could produce a clearer picture of how Axelson figured in the matters under inquiry, Egan said.

Egan said Bell told the President that the investigation was likely to drag on for another month or more and that the Justice Department, because of its obligation to do a thorough job, "could not and would not rush things."

Egan said it was his understanding that Bell made no recommendation to Carter and Blumenthal about whether Axelson's nomination should be dropped. he also denied that there was any impropriety in Bell's decision to keep close tabs personally on the investigation.

Some Justice Department attorneys reportedly have expressed concern that Bell's frequent inquiries about the investigation's progress had the effect of making it into a political case.

Egan said Bell has an obligation to report to the President on the qualifications of nominess, and since this was a matter of priority interest, he was simply trying to find out what was going on."

The Brooklyn grand jury indicted a former Penney official. Andrew Tsanas, and his wife last week. They were charged with evading taxes on almost $1.4 million in unreported income, much of it reportedly in kickbacks and payoffs by Penney contractors.