He's lying. He said he supported gay marriage in 1996 when he ran for the Illinois State Senate but then changed his stance on it in 2004 when he ran for the federal Senate and in 2008 when he ran for President in order to get more votes from moderate and conservative Democrats. He just uses the "Sasha & Malia helped me change my mind about it" thing to make his evolution on gay marriage seem more organic, because he doesn't want to admit that he pretended to be against it in order to gain votes. He has always supported it but doesn't want to admit that he lied about it for over 10 years in order to get elected.