When the following word begins with a vowel or mute h. liaison occurs, the -s is pronounced z
and joins the following word. This happens to any final -s when
followed by a word beginning with a vowel or mute h.
Basically the final -s of tous is pronounced when the word isn't used to directly introduce a noun phrase.
In other words, in phrases like tous les garçons, tous (les) deux, the final -sisn't pronounced.
In other cases, the -s is generally pronounced (as [s], not as [z]), e.g.: Ils sont tous venus on le fera tous ensemble Bonjour à tous!
Theoretically, and as a separate issue, in the cases where the final -s is "not pronounced" , you could actually get it pronoucned as a [z], i.e. as a liaison consonant (in the same way as in les amis). So for example: tous autres problèmes rencontrés = any/all other problems encountered. This is really not very common usage, though, and I think you can effectively ignore it.
I also forgot to emphasise (though it follows from what we we've been saying) that it means occasionally the pronunciation of "tous" is what distinguishes between two meanings. Stealing the example from Le Robert, Dictionnaire des difficultés du français, consider the sentence:
Ils ont tous leurs bagages
If you pronounce the -s on tous, it means "They've all got their luggage". If you don't pronounce the -s, it means "They've got all of their luggage". In effect, not pronouncing the -s signals that "tous leurs..." goes together as a phrase.
I was merrily going around with my 'tous or tous without the 's' and not aware of any problem until I was so unfortunate as to chance upon this discussion on 'tous' so to speak and now I don't know which 'tous' I am supposed to use. Do I really have a problem with tous, well I will wait till the native speaker of french correct me on that, may be out of courtesy they wouldn't point out my mistake. I always point out mistakes to people who speak my native language on the assumption that I am doing them a favour. Maybe they appreciate that.
Well, if you mean you never pronounce the s on tous, there are definitely cases where it is pronounced (such as above), and not pronouncing it would change the meaning of what you're saying (because it would then sound like tout, meaning "all, everything"). So I would recommend trying to follow the patterns given above.