Can polystyrene sulfonate bind calcium or sodium in the gut? How?
Are you talking about Sodium Polystyrene Sulphonate (a.k.a SPS)?

If yes, then ...  

Quoting from Chaitman, Dixit and Bridgeman (2016)  


  Synthetic cation-exchange resins are insoluble polymers resembling a crystalline lattice. When placed in a solvent, this structure swells, allowing the exchange of ions between the reactive group on the resin (in the case of SPS, sodium) and ions dissolved in the solvent.


However, other cations like sodium and calcium ions can bind too.
As SPS moves through the intestine, sodium ions are released and exchanged for potassium ions.


References
Chaitman M, Dixit D, Bridgeman MB. Potassium-Binding Agents for the Clinical Management of Hyperkalemia. Pharmacy and Therapeutics. 2016;41(1):43-50.