The leader of the socialist part Pedro Sanchez has been elected by the Parliament the new Prime Minister of Spain after Mariano Rajoy was forced out of office.