If you moved to Spain before January 1, 2021, you're covered by the Withdrawal Agreement.
If you moved to Spain on or after January 1, 2021, you're covered by the Trade and Cooperation Agreement (TCA).
Important: "Moved to Spain" means you established legal residency in Spain before the cutoff date. Simply owning property or visiting does not count—you must have registered as a resident (obtained a green certificate or TIE) before January 1, 2021.