If 50% or more players sleep in a bed during the night, it will become day.
If a player is considered AFK (their name in the tab list will be grey), then they will be counted as sleeping.