First off, it’s not “returns true” but “succeeds”.
Secondly, you’re writing a message if there’s a duplicate; you should just succeed (at least, I assume that’s what your instructor wants).
Third, the first clause of queHas_Duplicate/2 is intended (I presume) to check for the count equalling 2; but all it’s doing is setting the count to 2.
Some hints:
When you consulted this program, you probably got warnings about “singleton variables”. Those warnings should usually be taken seriously.
A duplicate exists if the count is 2 or greater (not just equal to 2).
How would you describe the action of checking for a duplicate in English (or whatever your native language is)? Try to write down a formal definition, and then see if you can write a predicate that matches that
Just to be fair to the OP. As they are new here they actually partially posted a question then posted the same question in full. I suspect they accidently committed the change, then not knowing how to edit the mistake started again. I did delete the partial question as it was obviously a partial of the following post. In that I do recall them using Please in the title, so I will fix it for them.