In modern underwater warfare, detecting and locating enemy submarines is the primary task, but there are still many difficulties in detecting submarines. The acoustic signals may distort in the ocean channel due to the complexity of the ocean, which affects the detection of sonar. That is to say, the impact of environmental factors needs to be considered in submarine detection. Therefore, this article proposes an underwater collaborative detection method based on complex marine environments, constructs a sonar underwater detection capability analysis system to improve detection performance, analyzes the impact of marine environmental factors on sonar detection capability, evaluates sonar performance using sonar quality factor, calculates sonar detection distance, establishes polar coordinates, and explores sonar detection capability; Besides, the concept of collaborative detection is also introduced, and a collaborative detection probability distribution surface is proposed to fuse the detection capabilities of different platforms, presenting the collaborative detection capabilities of multiple platforms in the form of probability contour lines. The detection performance of different deployment methods is explored by changing the placement position and number of platforms. At last, the research has shown that the underwater detection capability of sonar is closely related to the marine environment. The square layout in underwater collaborative detection has better detection performance. The research results of this article can provide references for the layout of platforms in underwater detection tasks.