The rental period for the long-term rental is one year. Thereafter, the contract is extended automatically, each time for 1 year up to 3 years, should it not be terminated by the renter.
There are some differences in Spanish tenancy law, so you should inform yourself before signing a contract.