Four hours before the walls around him exploded in a shower of concrete, plaster and glass, Mustafa Saad sat at his desk, a smiling, confident man of 33 planning for the day when the military occupation of his city will end.

That day is expected to be Feb. 18, the date Israel has set to complete the first stage in its planned three-stage withdrawal from southern Lebanon. For the first time in more than 2 1/2 years, Sidon and the surrounding area will no longer be under the control of the Israeli Army.

But in a reminder of the violence that has seemed to follow the Israelis into Lebanon and on their way out, a car-bomb explosion yesterday tore away the front of the five-story apartment building where Saad lived, killing two men and injuring more than 30 persons. Saad, critically injured and reportedly in danger of losing his sight, is in Paris tonight for emergency treatment.

His wife, who was also injured, is with him. Their 11-year-old daughter is in Beirut, reportedly in a coma.

Saad, the son of a slain Lebanese politician and one of the most important men in town, was deeply involved in planning for the transition and efforts to prevent the kind of sectarian violence that occurred when Israeli forces withdrew from the Chouf Mountains to the north in 1983.

"We are being very careful not to let there be a chance for bad things to happen," he said. "But we don't know what the Israelis are planning." Many Lebanese, including the government in Beirut, were quick to blame the Israelis, rather than one of Lebanon's own rival sectarian militias, for yesterday's bombing. An Israeli Foreign Ministry spokesman called the Lebanese government's charge "irresponsible" and "a lie."

There was a general strike in Sidon, and strikes were called elsewhere in southern Lebanon today to protest the bomb attack on Saad. Shops were closed, few people were on the streets of the city, and the normally congested coastal highway was relatively free of traffic.

Yesterday's bombing could be just another violent episode in Lebanon's tortured history, or it could mark the beginning of the ordeal of Sidon. That is what Saad and others here said they hoped to avoid.

Certainly all the elements for an explosion are present in the area the Israelis are to evacuate next. North of the present Israeli line on the Awwali River, there are Christian Phalangist militiamen and, near them, the Phalangists' bitter enemies, armed Lebanese Druze militiamen. Soon these two forces will have access to the south.

East of Sidon, in the Ain Helweh refugee camp, there are approximately 50,000 Palestinian refugees, including about 1,200 former inmates of the Israeli prison camp at Ansar. They are the Israelis' enemies, but what they fear most is a repeat of the 1982 massacre of hundreds of Palestinians by Phalangist forces at the Sabra and Shatila refugee camps in west Beirut. They must also fear an outbreak of fighting between rival factions of the Palestine Liberation Organization in the camp.

Sidon is a predominantly Sunni Moslem city. But the surrounding countryside that the Israelis also will evacuate is a sea of Shiite Moslems who have grown increasingly militant during the military occupation.

The Israelis are leaving, and no one knows who, or what, will follow them. While life proceeds normally here, there is a clear sense of unease over what will happen when Israel's military might is gone and the Lebanese and the Palestinians are left to themselves.

In Ain Helweh, relief agencies are stockpiling extra medical supplies and planning to open a system of small satellite clinics in the camp in case there is an outbreak of fighting and a need for scattered but accessible medical facilities.

Bomb shelters in the camp, which were destroyed by the Israelis in 1982, are gradually being rebuilt, just in case the camp is again the target of shelling.

People identified as collaborators with the Israelis have been targeted, and several have been killed in the last few months. Known collaborators no longer enter Ain Helweh, and many are planning to leave the area before the Israeli Army does. One of the most notorious, Saad said yesterday before the explosion shattered his world, was at that moment "selling his furniture."

"There is a real Catch-22 for the Palestinians," said Bruce Campbell, the administrator of a hospital at Ain Helweh run by the U.S.-based International Rescue Committee. "They have been pushing for the Israelis to leave, but they are fearful; the Palestinians don't have control of the government and they don't have arms."

Campbell added: "After the incident last night people are very worried. I have been personally optimistic, but people were shaken by last night's event."

Mustafa Saad had also been optimistic. Sitting behind his small desk, dressed smartly in a dark jacket, white shirt and tie, he said yesterday that he and other leaders representing virtually all of the communities in the area were meeting regularly to plan for the approaching changeover.

He said they did not expect an outbreak of fighting among PLO factions in Ain Helweh, where he said there are only small arms hidden among the refugees. If the Phalangist militiamen attempt to move against the Palestinians, as they did against the Sabra and Shatila camps, they will be resisted by local Sidon forces so there will be no repetition of the Beirut massacre, he said.

The collaborators will leave the area, or be forced to leave, Saad said. He laughed, but did not answer, when asked what would happen to anyone who refused to leave.

Saad said there was one possibility that he did fear. It was that the Israelis would attempt to stir up trouble as they left the area.

"We expect it is in Israel's interest to make the situation here explode after they withdraw, but we are taking all possible measures to prevent that," Saad said. "Still, it is not easy."