Energy efficiency and spectrum sensing performance are two crucial parameters in cognitive radio networks. Enhancing energy efficiency should not come at the cost of sacrificing spectrum sensing performance. This paper introduces a novel sensing node grouping algorithm to address the challenge of balancing energy efficiency and sensing performance. The proposed algorithm first prioritizes spectrum sensing training for each node and estimates their reliability. Nodes with reliability values exceeding a predefined threshold are selected for cooperative spectrum sensing. The selected nodes are divided into two groups using a staggered grouping approach, ensuring equivalent sensing performance between the groups. The groups alternate in performing spectrum sensing operations, with one group engaging in sensing while the other participates in data transmission or remains idle. The optimal number of cooperative nodes is determined through a greedy algorithm, formulated as a constrained optimization problem. The objective is to maximize energy efficiency subject to a constraint on the error probability, ensuring the highest possible energy efficiency while satisfying the required sensing performance criteria. Experimental results demonstrate that the proposed algorithm effectively maximizes energy efficiency while fulfilling the sensing performance requirements. Compared to traditional algorithms, the dynamic grouping algorithm significantly enhances spectrum sensing performance and improves energy efficiency. The algorithm is adaptable to various network configurations and environmental conditions, addressing the challenges faced by existing solutions. This research contributes to the advancement of cognitive radio networks and their applications in various domains, offering a comprehensive and adaptive solution to optimize energy efficiency and spectrum sensing performance.