For several years local officials have thought they could meet federal requirements for housing the poor by permiting subsidized projects for the elderly rather than for families who are not old.

And for a while the Department of Housing and Urban Development went along.

But now HUD is pressing them to accept housing for poor families, and the protests are being heard all the way to Washington.

The problem is that politically elected officials tend to find elderly low-income people acceptable to their communities, but they find low-income families with children . . . well difficult.

For example, last month several suburban officials from Michigan, who were here for an annual meeting with Democratic Rep.William D. Ford, demanded to know why HUD is trying to "force" them to take subsidized family housing.

At a seminar arranged by Ford, they described to a HUD assistant secretary, Marilyn Melkonian, their communities fears about the addition of poor minority families to their neighborhoods:

Those people would bring crime, vandalism, school integration controversy and new burdens on municipal services.

Elderly people, on the other hand, are neat, quiet and no trouble.

One official asked whether HUD would "indemnify us from property damage" if his community permitted a subsidized family development. (The answer was no).

The discussion reflects a dilemma that communities are facing with increasing frequency - 13.6 million Americans, 2.3 million of them over 62 years of age, are living in dilapidated private housing, and public funds for better shelter are limited.

Furthermore, a 1974 law requires localities receiving community development funds - money they can use for parks, sewers, recreation centers, street lighting - to submit what are call HAP's housing assistance plans, that detail the housing needs of poor families and of poor elderly people. The plans also must tell what the localities are going to do about those needs.

In the last three years communities have overwhelmingly accepted new subsidized apartments for the elderly but have now done little or nothing for poor families. In fact, this year fully 75 percent of new starts in apartment rental units aided by subsidies under Section 8 of the 1974 law have so far been designated for elderly.

To counter the trend HUD has begun to tell localities they cannot have more subsidized units for the elderly until they accept such aid for needy families.

Beyond that, the department threatens to cut off community development funds to localities that refuse to meet the family housing needs cited in their own HAPs.

The threats are real. To date this year HUD has cut off development momey to five communities, including $1.4 million to Pomona. Calif, and nearly $1 million each to Livonia, Mich., and Midland, Tex. In 1975 and 1976 under the Ford administration, HUD cut off aid to 11 localities.

Fairfax County just went through a bruising battle with HUD, and finally, after a seven-month delay, decided to accept a subsidized housing project for low and moderate income families in the Springfield area. It was either that or lose $3.8 million in HUD development funds.

Lawrence B. Simons, HUD's assistant secretary for housing, said that "greater force is being brought to bear to get communities to balance out their HAP plans.

"Developers come to us with projects for the elderly and we ask, 'Where's your family project?' We hope that by jawboning we can accomplish our goals."

The goal this fiscal year, which ends Sept. 30, is to increase the Section 8 starts for new family housing so that they total 40 percent of all Section 8 starts, thus cutting the share for the elderly to 60 percent.

While HUD officials say they are "hanging tough," they also are proceeding gingerly, particularly in view of the House vote last week to give either house of Congress a veto over furture HUD regulations.

The House vote was a rebuke to HUD for proposing a regulation last year saying that 75 percent of a community's developments grant must be spent on projects that benefit low-and moderate-income people. HUD later retreated in the face of local objections, but it still requires that 51 percent of the money be spent for such projects.

Now, some HUD officials worry that the elderly will descend on them. "They've got a hell of a lobby - they're dynamite," said one HUD source.

HUD is spending nearly $4 billion this year to construct and rehabilitate housing units and subsidize the rents of the people who live in them.

In proportion to their numbers, the elderly poor have benefited greatly from public housing and subsidized private housing.

For instance, of the 32 million people now living in 1.2 million public housing units, 48 percent are elderly. Of another 3.2 million people now living in subsidized, privately owned apartments, 35 percent are elderly. The only assistance program that has not benefited the elderly is one that subsidizes home ownership.

Richard M. Millman a Washington attorney who represents nonprofit organizations that build apartments for the elderly, argues that the elderly, rather than families, should be given priority. Younger people can work out of their poverty, he says, "but the elderly have less time to wait. They're locked in. They've been shelved, so to speak."

But Florence Roisman, a lawyer here for the National Housing Law Project of the Legal Services Corp., applauded the new HUD approach as an effort to correct "an egregious imbalance." Yet, she noted, some local HUD activities, such as a demonstration project in Hoboken, N.J., that will displace subsidized families and provide units for the elderly, run counter to HUD's national pro-family program.

For many localities the housing problem leads to other problems. For instance, Mayor Frank P. Swapka of Dearborn Heights, Mich., a Detroit suburb, said HUD has threatened to cut off an $826,000 development grant because the city council has voted 5 to 2 not to accept federal rental subsidies for 20 poor families. But it plans to allow a 200-unit high-rise for the elderly.

"We could have handled the 20 families," Swapka said. "But the council acted after the people got scared because someone mistakenly said we were going to put in a low-cost housing project in a wealthy part of town.

"Some of us went to Washington last month to see if HUD would relax the rules for us, but they said we had to follow the rules.