Homeowner's insurance (seguro del hogar) covers your house, the home itself and the things you keep in it against disasters: fire, wind, etc.
The premium of the policy depends on the value of the house, the things you keep in it and the risks you wish to be covered.
When a house is rented, it may only be insured by the landlord. The tenant may insure its contents.
There is no law that requires a homeowner to have insurance, however, if you borrow money to buy a house, the bank will normally require you to contract, at least, fire insurance to protect its interest until the loan is repaid.