A man accused of murdering a woman and her unborn child in 2006 and murdering another woman in 2008 has pleaded guilty.