Ok, you've really got to stop the 'Bait and switch'
How do you do A : by doing x
How do you do B : by doing y
Now how do you do both A and B at the same time :by doing z
Great, but what I really want is A B and C...
Ask what you really want in the first place.
Anyway, that said.
Try
=IF(OR(F2="",G2=""),3,IF(OR(F2>0,G2>0),1+(F2=G2),0))