Privacy is vital for outsized and opaque ad hoc networks. A preference-based protocol for trust and head selection (2PTH) algorithm is proposed for communication privacy from intermediate malicious nodes. A 2PTH algorithm is a combination of preference-based trust selection algorithm (PTA) and preference-based head election algorithm (PHA). To discover routes with trusted nodes, PTA is proposed for determining a route without malevolent nodes for forwarding packets based on Weight assignment to trust parameters. The work also proposes a PHA, based on internal and external factors of a node, aiming at finding quick response during the routing process. Simulations are performed using NS2 simulator. We compare the proposed 2PTH algorithm with other clustering algorithms, which are cluster-based trust-aware routing protocol, 2ACK model and low energy adaptive clustering hierarchy. Our analysis and simulation results show that, the proposed 2PTH algorithm efficiently detects and isolates malicious nodes, and it outperforms the other algorithms.