The name tells you what the resin exchanges out, not what is stuck on the backbone. That one sentence clears up most of the confusion here.
Cation exchange resin — example: sulfonated polystyrene (Dowex 50, Amberlite IR-120)
Backbone: polystyrene cross-linked with divinylbenzene, then sulfonated to hang −SO3−H+ groups off the rings. The fixed charge is negative (sulfonate), so the mobile, exchangeable ion is a cation — here H+.
R–SO3−H+ + Na+ → R–SO3−Na+ + H+
This is the strong-acid resin in a water softener: it grabs Ca2+ and Mg2+ and releases Na+ or H+. A weak-acid version swaps the sulfonate for a carboxylate (−COO−H+), e.g. polyacrylic acid resin.
Anion exchange resin — example: quaternary ammonium polystyrene (Dowex 1, Amberlite IRA-400)
Same polystyrene–DVB skeleton, but the rings carry −CH2N(CH3)3+OH−. Now the fixed charge is positive, so the exchangeable ion is an anion — OH− or Cl−.
R–N(CH3)3+OH− + Cl− → R–N(CH3)3+Cl− + OH−
A weak-base version uses a tertiary amine (−N(CH3)2) instead, which only works while protonated, so it loses capacity above about pH 7.
The trap
Students routinely call the quaternary ammonium resin a "cation resin" because the group bolted to the polymer is a cation. It is not exchangeable — it is covalently bonded to the backbone. Classify by the counter-ion that can actually leave.
Run both in series and you get deionized water: the cation bed swaps every cation for H+, the anion bed swaps every anion for OH−, and the two combine to H2O.