Prevent mac from requiring login screen at home

I would like to prevent my mac from sleeping when I'm at home. I trust the people in my house, and would like to stop it from being locked.

Or even better, maybe it could only require a password after 30 minutes?


If you open terminal and type caffeinate it will never sleep until terminal is quit (when you get home).