'lo' is used before masculine nouns (or noun phrases) beginning with s+consonant (sc, sp, sq, etc), z, x, gn, and maybe a few others I don't remember. 'il' is used before other consonants. l' before vowels.
That's the kind of details that give Italian its incredible singing quality: for them, saying "il squalo" with three consecutive consonants (l, s, qu) is just WAY too harsh. Hence avoiding the problem by saying "lo". Imagine how rough a word like "strengthen" must sound to them.
Hahaha. It's why they can't learn German or any of the Slavic languages. Too many consonants in a row...