"Everyone who knows Trump says he is definitely not a racist"
Trump doesn't have enough of an ideological core to be racist or to be not racist. The only ideology Trump has is the advancement of Trump.
But!
Trump is willing to play to the racist component of his base with the kind of ridiculous comments he made after Charlottesville to keep them happy and in his corner.
It's the same reason that Trump abruptly ordered the military to kick all transgender people out of the military. Trump doesn't care one way or the other about gay or transgender people, but he knows that throwing them under the bus keeps his conservative Christian base happy.