The first major federal housing legislation in three years--aimed at assisting tens of thousands of American renters, homeowners, buyers and builders--is heading for political disaster on Capitol Hill.

No one in the Senate or House leadership wants to admit it publicly yet, but evidence is mounting that Congress will fail again to produce anything substantive in the housing arena.

Just four months ago, the outlook was markedly different. Democrats and Republicans on both sides of the Capitol agreed that new housing legislation was needed in 1983.

They said that FHA mortgage insurance programs for rental and home ownership financing require updating and improvement, and that some form of moderate-cost subsidy program for construction or rehabilitation of housing for lower-income Americans is essential, particularly in view of the phase-out of the Section 8 rental assistance program.

Numerous other issues related to housing and real estate need attention as well, Republicans and Democrats agreed.

With a little bipartisanship and accommodation on both sides of the aisle, "We're going to get a bill to the president this year," possibly even before the summer recess, Senate Housing Subcommittee Chairman John Tower (R-Tex.) said in February.

The optimism of early 1983 is wilting fast in the heat of spring on Capitol Hill, however. Although the key banking committees in both houses reported out thick, ambitious bills before heading home for the Memorial Day recess, political traumas await both of them on their return.

Put in a nutshell, the situation is this: The Senate Banking Committee reported out its version of the 1983 housing authorization bill, with several new major federal initiatives attached. The bill (S.1338) would create a $300 million "rental rehabilitation" program under which states and cities would funnel money to apartment owners to renovate units for lower- and moderate-income families.

The Senate bill also authorizes, among other items:

* A housing "voucher," or rental subsidy certificate, program for 60,000 low-income households. The voucher approach, which is far less expensive than construction subsidies, would allow low-income families to shop for decent apartments in their communities. Local public housing agencies would pick up the difference between 30 percent of a family's adjusted income and the cost of renting a unit. Standards for the local fair-market rents would be somewhat less generous than those used by the Department of Housing and Urban Development in its existing Section 8 program.

* A $750 million foreclosure-relief program to help homeowners delinquent in their mortgage payments avoid foreclosure by private lenders. The assistance would be through a second mortgage secured by the owner's house.

* Funds to construct 14,000 subsidized housing units for the elderly, $3.3 billion in authorizations for various forms of rural homeownership and rental loans, plus $100 million for a new rural preservation grant housing rehabilitation program.

The House version of the 1983 bill (H.R.1), as sent to the floor by the Banking Committee, is significantly different from the Senate's.

For starters, it provides $800 million in new contract authority for low-income-housing subsidies, including construction of units for the elderly, moderate rehabilitation of low-income apartment units, public housing and Section 8 units.

It also would create a $1.3 billion program of flexible grants to localities and states to support construction and renovation of rental and cooperative housing. Unlike prior federal housing subsidy programs, however, the new grant mechanism would allow localities to provide assistance in the form of capital grants, loans, interest-reduction subsidies or other techniques.

Like the action grant program, it would emphasize leveraging of federal dollars. This means that communities would seek to use as little money as possible to stimulate construction or renovation of the maximum amount of housing. If that could be accomplished best by a modest interest-rate subsidy for a private developer, that's the form it would take. Or, if it could be achieved best by local rent reduction contracts on behalf of low-income tenants needing decent housing, that's what would be done.

The House bill also provides $3 billion for rural housing, $1.5 billion for operating subsidies for local public housing, and $4.5 billion a year for community development block grants and action grants among other key provisions.

Both the House and Senate bills are lengthy and technical, but they share some important characteristics.

They both provide significant new federal funding to support construction and subsidy of housing for people who otherwise could not afford it. The Reagan administration, plus a number of key Republicans in both houses, would prefer to pay little or none of such subsidies, whatever form they take. Both bills also are wide open to political attack and parliamentary death-squad tactics. The longer they remain vulnerable, the longer the odds that any housing bill will be passed this year.

On the Senate side, for instance, it is now doubtful that the committee-passed bill even can get to the floor for a vote before September.

Not only is the Senate preoccupied with budgetary and other matters, but its leadership wants to recess for July and August--and put off anything highly controversial until the fall.

That has opened the door to a withering attack on the bill by its arch-critic on the Senate Banking Committee, conservative Sen. William Armstrong (R-Colo.). Armstrong has announced his determination to kill the Senate bill--and thereby prevent passage of any substantive housing legislation in 1983. Armstrong objects to virtually every key plank in the bill on spending or social policy grounds, or both.

Although a majority of the Senate probably would vote in favor of the legislation if it were sent to the floor today, according to Banking Committee sources, Armstrong's unyielding opposition will effectively prevent any action until September.

Among other delaying tactics, Armstrong hints that he will offer 100 or more amendments to the legislation if and when it arrives on the floor.

That's tantamount to a filibuster, conceded a staff aide for Armstrong, and it alone could derail the legislation.

Equally important, most Republicans in the Senate recognize that President Reagan well might veto the committee bill even in its present form because of its cost, the aide said. They also know that the votes for a veto override wouldn't be easy to put together, the aide added.

The fight on the House side is different. There, the Democratic majority, which pushed its bill through committee markups with few deferences to Republican complaints about budgetary costs, appears likely to pass a 1983 bill.

The House probably will do so without appropriations for several of its major new housing initiatives such as the $1.3 billion grant program, however. The Democratic-controlled Appropriations Committee didn't put money into this year's bill "because we don't think there's going to be a housing bill to fund," a staff source said.

Compounding this political feuding between and within parties on Capitol Hill are two other factors that are beginning to work against successful enactment of 1983 substantive legislation.

First, with the housing recovery now underway, there is less urgency--or at least Congress perceives less urgency--to meet the demands of powerful trade groups such as the National Association of Home Builders, the National Association of Realtors and the National League of Cities.

The homebuilders "keep telling us they'd like legislation this year, but the truth is, they're not pushing hard," one key House staff member said. "A majority of their members don't really want or need more federal legislation or spending, and people up here understand that."

The groups that care most--those who represent cities and low-income housing tenants--"really don't cut much cheese at the White House," he said. "They're not a political threat."

Add to this still another factor: The longer the stalemate over 1983 housing legislation drags on, the larger the 1984 political campaign looms.

Just as some Republicans would like to boost that they blocked a "budget buster" bill and saved the taxpayers money, so, too, will Democrats want to use the third straight failure on housing legislation as further evidence that the White House--and Republicans in general--are anti-housing, anti-blue collar and uncompassionate.

Thus, the longer the clock ticks on the 1983 housing bills, the greater the chance for the dynamics of the 1984 electoral season to apply the final, crushing blow.