You need something that gives the result of the comparison operator as text, and not as a return status. This will be the arithmetic expansion : $((expression)).
Note that bash contains a numerical expression, a conditional compound expression - (( expr ))- which is often easier to use for numerical comparisons than a non-numerical expression [[ ... ]]conditional compound.
Combining this, you are looking for:
if (( $(($1==0)) == $(($2==0)) )); then
:
if (( ($1==0) == ($2==0) )); then
, $1 $2 , , boolean not (!) 0, 1. , ( . ):
if ((!$1 == !$2)); then
: script, , !, ( : , - .)