That's because your formula currently will put 1
for all unique rows and 0
for all duplicate rows, irrespective of whether they appear for the first time or not.
You can get the behaviour you're looking for by playing around a bit with the range lockings. For instance, you could try this:
=IF(COUNTIFS($A$2:$A2;A2;$B$2:$B2;B2;$C$2:$C2;C2)=1;1;0)
On the first row, the above formula will count only within the first row, so the result is bound to be 1.
When it reaches the second row, it will check the first 2 rows and will find that it's the same as the first one, so will return 2
as count and give you 0
.
Notice how I locked the ranges: The first reference is completely locked $A$2:$A2 while the second one has the row variable $A$2:$A2.