First you need to have a 5.1 Sonos set up. This is usually a Playbar or base, subwoofer and 2 Play speakers. You may also need a Sonos Boost.
Second check that the TV can output in 5.1. You may need to change the audio output type in the TV menu.
Third if you can't get the PC to see the 5.1 set up through the TV you may need to run an optical cable from the PC directly to the Sonos.