We present a computational study of PbCoO$_3$ at ambient and elevated pressure. We employ the static and dynamic treatment of local correlation in form of density functional theory + $U$ (DFT+$U$) and + dynamical mean-field theory (DFT+DMFT). Our results capture the experimentally observed crystal structures and identify the unsaturated Pb $6s$ - O $2p$ bonds as the driving force beyond the complex physics of PbCoO$_3$. We provide a geometrical analysis of the structural distortions and discuss their implications, in particular, the internal doping, which triggers transition between phases with and without local moments and a site selective Mott transition in the low-pressure phase.