WHEN THE IRS tacked a $2.8 million tax lien on the door of his house in McLean, Va., international arms dealer Frank Terpil shaved off his mustache, packed his Idi Amin T-shirts and said his farewells to the girls at "The Apple Tree" disco.

Now the former CIA agent is missing, feared by the government to be a fugitive who fled the country to avoid prosecution on charges of training terrorists, selling guns and exporting high-powered explosives.

What a plot twist for the film companies, including 20th Century-Fox, that were dickering to buy his life story.

The British producer who outraged the Saudi Arabian royal family with the television movie "Death of a Princess" was one of those bidding on a Terpil script. The movie might even placate the Saudis somewhat, since that country is one of the places some Terpil watchers think he might go.

That's where Terpil's buddy, Amin, is hidding out with his wives and children. The two men have talked regularly by trans-Atlantic phone, kidding about the day Terpil will mount an invasion of mercenaries to return "Big Daddy" to power.

"Not this year, Excellency," Terpil told Amin recently when it became obvious to both of them that Terpil's own problems in this country would have to take precedence.

Terpil has flaunted his closeness to Amin. His favorite attire was a T-shirt emblazoned with the number "7" on the back. Amin is a believer in numerology. A likeness of Amin decorated the front with the proclamation: "King of All Africa and Conquerer of the British Empire."

Terpil had boxes full of the shirts. Amin had ordered them from the U.S. to be worn by his soccer team at the Olympics. He insisted that every player had to be a "7".

On the library wall of his half-million-dollar house in McLean, directly across the road from Ethel Kennedy and her "Hickory Hill" estate, Terpil had a huge framed picture of Amin riding a bicycle.

He felt that bicycle showed the crafty intelligence of a man most of the world considers to be either a madman or a monster, or both.

According to Terpil, a neighboring African country had been refusing to allow gasoline supply trucks to cross borders into Uganda. Amin supposedly said nothing until the country's ruler arrived for a state visit.

Amin showed up with an entourage on bicycles and invited the potentate to peddle back to the capital with him.

"It's only 22 kilometers," he said. "We would have brought the limousines, but of course with the gas shortage . . ."

The trucks were rolling again that night.

When Amin fled Uganda, Terpil ended up with five expensive automobiles, including a vintage Rolls Royce that had been built for a member of the British royal family and given to the king of Uganda. All were flown to London aboard a C-130, where Terpil claims to have them still in storage. If Scotland Yard and U.S. law enforcement sources are to be believed, Terpil owns a lot of things in England, including a hotel "safe house" for spies and assassins and terrorists.

He is a man accused of many things. Described by almost everyone everywhere as "one of the world's major international arms dealers," he has been accused in print of supplying arms to Uganda and Libya and the PLO.

Stories of all kinds spring up around such a flamboyant figure. He denies all of the following claims, which have appeared in the press:

He trained Amin's dreaded State Research Bureau in espionage and sabotage.

He tranied Carlos, the Venezuelan-born terrorist who some intelligence sources believe planned the 1972 Olympics massacre of Israeli atheletes.

He has been charged in the indictment with recuiting American mercenaries to assassinate one of Libyan dictator Col. Muammar Qaddafi's political enemies for $1 million. The assassination was never carried out.

Terpil, indicted in New York last January and again in Washington in April, is a man about whom much has been written abroad. Yet most Americans had never heard of him until his name surfaced in "Billygate" in bizarre references that have never been cleared up.

Billy Carter, in Senate hearings, identified Terpil as someone who had acted as an "interpreter" for him during one of his visits to Libya but denied FBIallegations that Terpil had ever tried to involve him in a deal to sell machine guns.

The 40-year-old Terpil, a native of Brooklyn, speaks no foreign language that anyone who knows him knows about, except for a few words of Swahili that translate roughly: "Drunken White Trash."

Since Terpil doesn't seem, at the moment, ever likely to stand trial in this country, fact may never be separated from fiction in all the stories about him. Even when he is telling the stories himself, the truth is sometimes hard to track.

He has photographs of Che Guevara, taken seconds before his death and seconds after, along with a lock of his hair.

Was he there?

He left one listener in doubt, but assures another, hearing the same story on another occassion, that another American CIA operative gave him the mementoes.

He said he once "stole" a Russian missile for the U.S. on contract, only to have the American ship that was supposed to rendezvous for pickup and delivery fail to show up.

"I promised the crew of a Russian patrol boat more money than they had ever seen in their lifetime," he said. "I had promised them we would ram their boat and sink it after we got the missle off. Then our guys didn't show up. I think they probably thought I was setting them up."

At one point, Terpil got himself a literary agent and was talking about writing a book because his legal bills were getting enormous. The IRS was watching, he complained, to see if he spent any income for which he had not accounted in his tax returns. The book may never be written now.

He claimed to know the names of congressmen paid off by free-lance "spooks for hire." He claimed to know active-duty CIA officials who were willing to accept fees to moonlight commercial "reports" based on classified intelligence data.

He could cite instances in which American intelligence agencies were cheated of millions of dollars by one contract employee with a vivid imagination.

"He got $75,000 once for a Russian crab mine (land mine) that didn't exist," Terpil says. "He convinced them it did exist and said he was going to Lebanon to get one and got as far as the Bahamas, where he wrote his report on how he tried and failed. He still got his $75,000."

With delight Terpil will tell you that he is an "amoral" man. Ask why he left the CIA and he will answer:

"For fun and profit . . . to start my own little agency . . . why should I give money away to those other people when I can make it for myself? . . . I did not print bogus money in Beirut and get fired, as one story claimed."

The government has claimed that he has made millions, all now stashed in Swiss bank accounts. But the house in McLean isn't titled in his name. Neither is an office building on Connecticut Avenue.

Two sons, and two Filipino servants, are living in the house.

Terpil's wife, Marilyn, who was herself a high-ranking CIA operative, has been abroad for months.

"They think she's in Geneva, counting my money," Terpil said at one point.

One law enforcement source says Mrs. Terpil does not appear to know her husband's whereabouts. "She called the states last week, frantically trying to locat him herself," the source said.

There are those who think Terpil may be in Syria, which last week signed a merger agreement with Libya. Terpil is believed to have had a multimillion-dollar deal pending with his Syrian connection.

Wherever he is, he doesn't look the same, since he shaved his mustache.

The "Bob Guccione" of the FBI was asked last week to take an airbrush to a mug-shot, and touch it up in the same way that nude centerfolds in Penthouse are improved, to show Interpol how Terpil probably looks now.

Not that there were that many people who knew what he looked like before.

British publications were offering $100,000 for a photograph of him at one point.

There are a few people who fear that Terpil may not be alive. He says the Israelis would like to see him dead and claims Massad agents have already tried to kill him at least once in a hotel in Norway. He claims one former associate sent someone here to kill him several months ago. His friends believe him. Prosecutors don't.