I'd go on a what the thing is, basis. If our child was being stalked, abused, having a relationship with a controlling partner or any of that stuff I would have to tell DH and I would tell our child why.
Anything else, I would respect the confidence unless the issue became big, e.g. health worry, went for appointment, all fine, no worries, more issues surfacing, i'd say "I am going to have to share this with your dad because he really loves and cares about you and nothing that is happening will shock him or get in the way of his love for you. But I'd also say - keeping these secrets is harmful to all of us and could make family life harder when/if these secrets come out.
Boyfriend/girlfriend stuff, I would see how serious it was. If in any real doubt I would explain, I need to tell dad, but I will say it in a really clear way, and explain he is not to get upset/angry whatever with the child/teenager, even if he feels upset/angry about the situation.
Sometimes asking 'Can I tell?" Might give a child/young teenager the feeling of too much responsibility. EG they are being bullied and the parent asks if they can tell the teacher or the other parent. Sometimes kids need us to take charge and say this is how we feel, this is what is worrying and this is what I will do.
As they get older, over 18 etc or move away from home it may be harder.
My bottom line would be:
-Is there a risk (dangerous boyfriend) and by keeping the secret I am enabling the danger
-Could the other parent add something to help
-Will it damage the relationships with child or dh long-term to say or not to say, what is going on
Good luck.