Trevor McNeil and Sarah Montoya, both 35, would love to buy a home in San Francisco, but like many young couples, they make too much money to qualify for a below-market-rate unit and too little to afford a market-rate one.

So for now, they are stuck in their one-bedroom, third-floor walk-up apartment in the Sunset District, with twin boys who were born in January and a 2-year old girl. When one is crying, it’s hard to get the others to sleep, but the hardest part is taking the kids out. Their landlady won’t allow strollers in the lobby, so they have to lug a double and a single up and down two flights of stairs or put their daughter on a leash — something Montoya thought she’d never do.

Housing is expensive for everyone in the Bay Area, but it’s especially challenging for middle-income buyers. Most new supply is at the high or low end. The gap in between is often called “the missing middle.”

Between 2007 and 2015 in the nine Bay Area counties, permits were issued for a total of 27,451 units (rental and for sale) for low- and very-low income people making up to 80 percent of each area’s median income, according to data from the Association of Bay Area Governments. These are generally deed-restricted units with income limits.

By comparison, the region permitted 13,164 units that people making 80 to 120 percent of area median income theoretically could afford. And 110,159 units for people making more than 120 percent of median income received permits.

In San Francisco, lower-income people who have not owned a home in the past three years, attend a home buyer’s workshop and get counseling at an approved agency can enter a lottery to purchase a below-market rate unit through the mayor’s inclusionary ownership program. The income limit varies by unit, but buyers generally can’t earn more than 100 percent of the area’s median income for their household size. The San Francisco median is $103,750 for three people or $124,500 for five.

McNeil and Montoya didn’t qualify for a below-market-rate unit in the past because both were working. McNeil earns a little under $100,000 a year teaching middle school in Menlo Park.

They thought they’d qualify this year because Montoya quit her job as a hospital chaplain to watch the kids. But when the couple went for counseling, they were told they still wouldn’t qualify because the city would average Montoya’s past earnings and include it in this year’s income.

The Mayor’s Office of Housing and Community Development said it calculates income three ways and uses whichever is highest. One is to add the household’s gross income from the two most recent income tax returns and divide by two. This would put the couple over the limit, because Montoya’s income for the past two years averaged $60,000.

The couple looked into getting a Poppyloan, which offers up to 100 percent financing, from San Francisco Federal Credit Union. But they both have student debt, and the most they could borrow with their current income was $600,000, and that would have required them to cash in their retirement accounts for a $50,000 down payment, McNeil said.

In San Francisco, where the median list price is around $1,000 per square foot, that might buy a 650-square-foot house — no bigger than what they have now. McNeil’s father offered to co-sign a loan, but the credit union won’t allow co-signers who don’t live in the house.

If Montoya was working, they could buy a larger house, she said, but then they couldn’t afford day care, which runs around $1,500 per child per month at the center her daughter attended.

The couple has not considered moving outside of San Francisco. “My wife’s world is her community,” McNeil said. Living in their one-bedroom unit “is frustrating and unsustainable, but we know how lucky we are to even have a home, not to mention a good-paying job,” he added.

Maria Benjamin, who runs the city’s inclusionary ownership program, said applicants should provide as much information as possible about their individual circumstances. “Exceptional life occurrences happen and when they do they are considered by staff on a case-by-case basis,” she said in an email.

Most Bay Area cities have inclusionary housing programs that require developers to set aside a certain percentage of units for lower-income buyers — or pay a fee that cities can use for affordable housing elsewhere. For rental housing, they can charge an impact fee, based on the project’s size, to be used for subsidized housing elsewhere.

Local, state and federal funds are also available for housing development, although state funding was cut way back when California dissolved its redevelopment agencies, said Gillian Adams, principal planner with the Association of Bay Area Governments.

“The cost of building an inclusionary unit is the same as building a market-rate unit. But if you sell them at a lower rate, in order for the building to make economic sense, those costs have to be passed onto the market-rate units, which make those further out of reach for middle-income buyers,” said Matt Regan, a senior vice president with the Bay Area Council, which represents business.

In most eras, in most cities, middle-class housing is created through a process economists call filtering.

“Take a place like Dallas; it’s growing rapidly,” said Christopher Thornberg, founder of Beacon Economics. “What do Texas home builders build? They build high-end apartments, high-end homes. All these high-income people move into the high-end housing. Upper-middle-class people move into the housing they moved out of, and middle-income people move into the housing upper-middle-income people moved out of.”

But filtering only works if you have lots of new construction. “Nowhere in California is there lots of new construction,” said Richard Green, chairman of the Lusk Center for Real Estate at the University of Southern California. “That’s why you are not getting the filtering effect.”

California’s failure to create enough housing to keep up with population growth has been well documented. The Legislative Analyst’s office, in a 2015 report, blamed the shortage in coastal cities on “community resistance to housing, environmental policies, lack of fiscal incentives for local governments to approve housing” and high land and construction costs.

In the Bay Area, “We have created 540,000 jobs and approved 123,000 (new housing) units since 2011. For prices to be stable, we should have created one new housing unit for every 1.5 new jobs, or a total of 360,000 units,” said Paul Nieto, chairman of the Building Industry Association of the Bay Area.

One-fourth to one-third of the cost of housing construction in the Bay Area is the result of “discretionary decisions of government,” Regan said. This includes stringent earthquake, health and safety, disability access, energy-efficiency and other building code requirements. “All, on their individual merits, are admirable things society should aspire to. But we put all those costs onto the construction of new units.”

It also includes impact fees developers must pay for fire, police, water, sewer, schools, transportation, parks, libraries and other services. These fees can add an average of $100,000 per unit, Regan said.

These fees are partly a result of Proposition 13, which generally limits property tax increases to 2 percent a year until a property is sold and can be reasssesed. “The legacy of Prop. 13 is that existing homeowners do not pay their fair share for the needs of their communities,” Regan said. “So it tends to be the last person in the door, the new renter or purchaser, who pays for most of the needs of the communities.”

Prop. 13 has also encouraged some cities to favor commercial development over housing, because new stores and office buildings generate taxes without having to provide for the needs of new residents, said Cynthia Kroll, ABAG’s chief economist.

Thornberg said the way to provide more middle-class housing is to provide incentives for the private sector “to build way more housing than they are now. Even if it’s all high-end, that’s OK,” because it will trickle down to the middle class.

Abolishing Prop. 13, easing environmental and other regulations, reducing impact fees and union-labor requirements could encourage new housing, but none of those steps would be easy.

In San Francisco, where only 12 percent of households can afford a median-price home, supervisors recently passed Home-SF, a voluntary program that will let developers build taller, denser buildings if they make 30 percent of units available to low- and middle-income households. The city also has a down-payment assistance program for buyers earning up to 175 percent of the median income, although funds are limited and this year’s application deadline has passed.

A pair of state laws that took effect in January are designed to encourage homeowners to add a second unit to their property, which is another way to add lower-cost housing.

What can middle-income buyers do now? One thing is to look outside the high-price cities. “San Leandro is supposed to be a really nice family community. There are many other communities that are not San Francisco but have more community character than the newer developments,” Kroll said. Another is to “buy a bigger place and take in tenants.”

Kathleen Pender is a San Francisco Chronicle columnist. Email: kpender@sfchronicle.com Twitter: @kathpender

Income limits for

below-market-rate units

This is how the San Francisco Mayor’s Office of Housing and Community Development calculates household income to determine eligibility for its Inclusionary Housing Below Market Rate Ownership Program. For each household, the office will calculate income three ways and use the method that yields the highest annual household income.

Method 1: Use the most current pay stub, divide the year-to-date gross income by the current pay period number to get the pay period average. Multiply the pay period average by the total number of pay periods in a year.

Method 2: Use the most current pay stub (or the last pay stub received if the applicant currently receives no income) to determine the applicant’s year-to-date gross earnings. Add the year-to-date earnings to the household’s gross income from the most recent year’s income tax return. Divide this number by 12 (to account for last year’s earnings) plus the number of months the applicant’s year-to-date income encompasses. This is the average monthly income. Multiply this number by 12.

Method 3: Add the household’s gross income from the two most recent income tax returns. Divide this number by two.