Den (it) (with an N) is for replacing things that are common gendered. If "it" is replacing a word like bjørnen (the bear) or appelsinen (the orange) (almost anything that ends in an N is common gendered) than use den.
Det (it) (with a T) is for replacing things that are neuter gendered. If "it" is replacing a word like barnet (the child) or æblet (the apple) (almost anything that ends in a T is neuter gendered) then use det.
In this example, "De har den", den has an N at the end of it, so it is replacing a common gendered word - like appelsinen (the orange).
If, on the other hand, it said "De har det", det has a T at the end of it, so it is replacing a neuter gendered word - like æblet (the apple).
Use den for replacing common gendered words.
Use det for replacing neuter gendered words.
I hope this makes sense. If you need more help, it is always helpful to read the tips and notes.
That is a clear explanation of the rule. It does not however explain why "De har det" is not accepted as an answer. Unless there is some mystical way that we can know what the gender of the word that is referred to is.