Due to its applications in marine research, oceanographic, and undersea exploration, Autonomous Underwater Vehicles (AUVs) and the related control algorithms has been recently under intense investigation. In this work, we address target detection and tracking issues, proposing a control strategy which is able to benefit from the cooperation among robots within the fleet. In particular, we introduce a behavior-based planner for cooperative AUVs, proposing an algorithm able to search and recognize targets, in both static and dynamic scenarios. With no a priori information about the surrounding environment, robots cover an unknown area with the goal of finding objects of interest. When a target is found, the AUVs' goal become to classify it (fixed target) or track it (mobile target), with no information about target trajectory and with the constraint on maintaining the formation. Results demonstrate the good overall performance of the proposed algorithm in both scenarios.