Turn Lights On Only if After Sunset and If Presence is Detected

You needed to go one more level down to understand how to set a virtual switch to track time of day status Design Pattern: Time Of Day

And there are a number of threads on iPhone e presence detection like this (search is your friend) for determining changes in presence BEGINNER Guide to iPhone Presence?

Then it’s a straight forward rule to trigger on a change in time of day status or presence change and then verify in your rule that all conditions are true to turn on the lights.