The headlight switch has to be left in the auto position + it has to be dark enough out for the headlights to need to turn on + the "leaving home" feature must be turned on in the vehicle settings menu.
If you have the base model without these features I'm not sure if you can do it.
The 2014-2016 does not have this feature. Only the 2017 has it. This coming home light or whatever it's called, turns the headlights on when you unlock the car, if it's in auto and dark enough outside.
The 2014+ does have the leaving home feature, where you leave it on auto and when you shut off the car at night the light will stay on for whatever length of time you set it to.