It's usually okay to use either, but in these comparisons, both elements should be of the same type. It's better to stay home than to be late. Staying home is better than being late.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.