Socialdemokratiska PSOE:s ledare Pedro Sánchez får vara kvar som premiärminister i Spanien.