STORY: After three years of sleeping rough, Francisco Carrillo is overcome with emotion as he tours his new apartment in Madrid.

It's been provided to him by the charity Mundo Justo, or Fair World.

"I'm very happy, very happy, look at this room, it's mine."

"Tonight I'm going to dream all night, I'm going to sleep like a baby."

The 62-year-old pensioner found he couldn't afford rental prices in the Spanish capital when he moved from the south to seek treatment for throat cancer.

Carrillo is one of a growing number of Spaniards who have found themselves priced out of the market amid a shortage of social housing and regulations that deter long-term rentals.

The housing shortage has been exacerbated by a boom in rentals on platforms like Airbnb and Booking.com.

That has spurred a wave of protests across the country in recent weeks.

With housing in high demand, landlords are now demanding rent payment guarantees that many low-income renters can't provide - according to three NGOs consulted by Reuters.

Others are switching to the lucrative short-term market that isn't governed by the same regulations.

According to Idealista, the supply of long-term rentals has fallen 15% in a year.

Meanwhile, short-term rentals intended mainly for tourists increased by 56% in the year to March.

67-year-old pensioner Carmen Cajamarca was given a month to leave her rented Madrid apartment.

The building where she has lived for 25 years was sold to an Argentine fund refurbishing its units for holiday rentals.

"People have been thrown out onto the streets, evicting those who have lived there for years. The news reports that around 5 million tourists arrive, so they want the apartments for tourists. But what about the local residents who have always lived there and paid the rent? Where do we stand? Why do they want to do this to us? We are human beings, not animals, and even though they have more money than us, they should have some consideration."

Blanca Hernandez is the chair of Techo, the real estate investment trust that owns Carillo's apartment, and partners with Mundo Justo.

Techo, which went public in Spain in April, owns over two hundred flats and works with dozens of NGOs who charge rent at 30% below market rates.

"It's an impact investment that balances economic profitability with social returns, but the focus is primarily on social profitability. The aim is to help end homelessness and provide housing to social organizations that assist these individuals in their integration into society."

Hernandez says it's a win-win business model: expanding housing options for the homeless while enabling investors to secure a return.

A report by the European Commission found that Spain's social housing stock makes up just 1.5% of all homes compared to the European average of 9%.

The Socialist government's current plan for public housing will add 184,000 units over the next three years.

And Spain's prime minister has said he would like the social housing stock to match the European average during his term ending in 2027.

But the Bank of Spain estimates that 1.5 million more homes are needed to pull Spain even.

The country's housing minister said on Tuesday that the government had begun to work on a new plan to meet that target.