The Spanish Law differences between living at your home or living just temporaly. The temporaly rent means living for less than one year. The "vivienda habitual" rent means that you will live there forever.
The type of contract that you will have to sign is completely different. On the vivienda habitual rent, you can extend your contract up to 5 years, even when you just have signed it for 1 year period. But, you will have to pay for all the bills, and contract directly with the suppliers (electricity, gas, teleohone, internet connection, etc). That means that you will have to add to your rental price about 200€ per month to pay those bills. Also, you will have to pay in advance at least one month rental as a Security Deposit for the owner and other one month rental if you rent it through an agency plus the monthly fee.
The short term rental contract is different. There, the maximum contract period is for 1 year and can not be extended. Usually all the bills are included in the price: electricity, heating, Internet connection. So, the rental price is a fix price, you will not have to spend more money. Also, they are fully equipped, even with bed linen and towels, and all the kitchen appliances. That is a great saving because you only need to bring your personal things. And the Security Deposit, which will be refunded at the end of your stay is usually much lower or, as in many apartments that we manage, you will be just asked for your credit card details as a guarantee. They will not charge you any amount in it if there are not any damages in the apartment at departure.
So, now you can decide. But my suggestion is that when you are looking for a flat in Madrid for an stay shorter than one year, you must check also the short term rental apartments websites as homesfortravellers.com because you can find quality central apartments even cheaper that the ones you could find in a normal rental agency.
If you have any question, please, do not hesitate in contacting with me. I am happy to help you.
You can email me or reply this post.