Identifying the operational lines and estimating their impedances are critical problems in distribution grids with applications in fault localization, power flow optimization and others. This paper proposes an exact topology and impedance learning algorithm with low complexity that is able to solve problems using only voltage and injection measurements from the terminal nodes in the grid. The crucial benefit of this approach compared to existing works is that it does not require independence of nodal injections. That is, the proposed algorithm is able to recover the topology and impedances even when injections at the terminal nodes are correlated. In addition, its sample complexity for the accurate recovery is described under the multivariate Gaussian assumption of terminal nodes injections. The performance of our learning algorithm is demonstrated through numerical simulations on both synthetic grids and MATPOWER test grid with linearized and non-linear power flow samples.