he ran for president in 2008, but the republican party nominated john mccain instead. he ran again in 2012 and was nominated to be the main republican candidate against president barack obama, but lost the election.