MARS: THE RED PLANET

Was Mars habitable in the past and if so what was needed for the planet to substain liquid water and Life?