it sounds like you are using integrated sound (which is okay)
windows sound effects, youtube, music players often do not use the rear speakers. you end up with a 2.1/3.1 sounding system normally
movies and games normally do use your whole setup so you should get 5.1 sound.
if you are not worried about "surround sound" and instead just want "some type of sound" from the speakers then you can always go into your audio properties and make the rear speakers copy the front speakers. if you play a movie/game where surround sound is supported you could either change the settings back to default or play without surround sound.
its how i deal with a 5.1 system hooked up to a computer. although i have an easier method of switching (i use a home theatre receiver so all i do is push a button!)