Our sample space has 36 distinct outcomes (these are the rolls 1,1 through 6,6) so 36 is the denominator in our probabilities.
For P(sum=5 OR sum=8), just find by brute force logic the distinct ways those outcomes can occur: 1,4 , 4,1 , 2,3 , 3,2 , 2,6 , 6,2 , 3,5 , 5,3 , 4,4. So 9/36 = 1/4 is our answer.
We employ similar logic to find P(NOT 9 or 6), except it is easier here to find P(9 or 6) and subtract that from 1.