SPF, DKIM and DMARC, but there's other factors as well. Gmail will usually tell you exactly why something was flagged spam. If you go to "Show Original" SPF, DKIM and DMARC should all show "PASS" if everything is configured correctly.
Hmm, not always. I've just setup my own mail server, I PASS SPF, DMARC and DKIM according to Gmail headers and yet my email is still classified as spam, as determined by "Gmail magic". I believe this is because the domain is relatively new and Gmail treats you as guilty until you prove your innocence (ie. Enough people mark my emails as not spam)