When a flight is delayed for more than 5 hours, the passenger can decide not to continue with their trip. In this case, you are entitled to a refund of the cost of your ticket and a flight back to the destination where you originally started your trip. You have all the information in: «Air passenger rights: how to make a claim to Aena«.
You have all the information in: "Air passenger rights: how to make a claim to Aena".