Location is one of the basic information required for underwater optical wireless sensor networks (UOWSNs) for different purposes such as relating the sensing measurements with precise sensor positions, enabling efficient geographic routing techniques, and sustaining link connectivity between the nodes. Even though various two-dimensional UOWSNs localization methods have been proposed in the past, the directive nature of optical wireless communications and three-dimensional (3D) deployment of sensors require to develop 3D underwater localization methods. Additionally, the localization accuracy of the network strongly depends on the placement of the anchors. Therefore, we propose a robust 3D localization method for partially connected UOWSNs which can accommodate the outliers and optimize the placement of the anchors to improve the localization accuracy. The proposed method formulates the problem of missing pairwise distances and outliers as an optimization problem which is solved through half quadratic minimization. Furthermore, analysis is provided to optimally place the anchors in the network which improves the localization accuracy. The problem of optimal anchor placement is formulated as a combination of Fisher information matrices for the sensor nodes where the condition of D-optimality is satisfied. The numerical results indicate that the proposed method outperforms the literature substantially in the presence of outliers.