for conditions you can use AND and OR if there are multiple condition
a1=5, and b4=10
=IF(AND(A1=5, b4=10), true, false)
a1=5 or b4 = 10
IF(OR(A1=5, b4=10), true and false)
NOW for your question
=IF(AND(a1>1, B1>1), "yes", IF(AND(A1=0, b1=0, A1<>"", B1<>""), "No", ""))
this says if both a1and b1> 1 then show yes
if both a1 and b1 = 0 and not equal to "" then show no. The reason for check for "" is if cell is blank, a1 will be evaluated as 0, so in case it is not desired
if neither conditions are met then show ""
You could have written same as (which is harder to understand)