A model of CuO$_2$ planes of cuprate perovskites, containing $d_{x^2-y^2}$ copper orbitals and symmetric combinations of oxygen $p_\sigma$ orbitals, is investigated using the strong coupling diagram technique. This approach allows one to take into account the interactions of carriers with spin and charge fluctuations of all ranges. Derived equations for Green's function are self-consistently solved for the set of parameters corresponding to hole- and electron-doped cuprates. It is shown that the mentioned interactions lead to the appearance of spin polarons -- bound states of carriers with spin excitations, which show themselves as sharp peaks of the density of states and spectral functions at the Fermi level. Hole and electron doping are strongly asymmetric. This, in particular, manifests itself in the antiferromagnetic response for the electron-doped case and in an incommensurate magnetic ordering for hole doping. In the latter case, the incommensurability parameter grows with doping. The double occupancy shows that the electron-doped system retains strong correlations up to the concentration 0.23, while for hole doping the correlations decay rapidly. These results are in agreement with experimental observations in cuprates.