In this paper, we theoretically analyse the uplink (UL) and downlink (DL) performance of massive multiple-input and multiple-output (mMIMO) networks, in term of coverage probability, cell spectral efficiency and network area spectral efficiency, using stochastic geometry. A sophisticated but yet practical system model is considered, taking into account a path loss model differentiating line-of-sight and non-line-of-sight transmissions, an idle mode capability at the base stations and a finite user density. Our analysis pays particular attention to the existence of a finite number of UL pilots for channel estimation and the effect of pilot contamination. We study for the first time the joint impact of the number of UL pilot sequences, the user density, and the base-station density on the pilot contamination issue in a mMIMO network, which in turn characterizes the DL and UL network performance. Moreover, using the proposed framework, we investigate two different scheduling problems—UE and pilot scheduling—, to find the optimal simultaneously scheduled UE density per time-frequency resource as well as the optimal UL pilot number to maximise the spectral efficiency.