This question already has an answer here:
In the Harry Potter series Harry's parents go into hiding by using a Fidelus Charm which needs a secret keeper. So they chose Peter Pettigrew as their secret keeper and were betrayed. Why didn't they make each other their secret keeper? James could have made Lily secret keeper (of his and Harry's secret) and Lily could have made James (of her and Harry's secret) their secret keeper. So there wouldn't have been any chance of third person betraying them.