Surround over S/PDIF requires active compression technologies like Dolby Digital Live. First party devices like the Xbox, playstation, DVD/Bluray players and some TVs will handle that automatically. On a PC, you need specific hardware and/or software to accomplish it. actually getting it working is usually a pain in the arse because the software part tends to be buggy.
Example product that advertises Dolby Digital Live: https://www.amazon.com/Creative-Internal-Headphones-Discrete-Supports/dp/B08HYPH5T6/ref=sr_1_5?keywords=creative+sound+card+optical+surround&qid=1655148890&sr=8-5