Hi When the boy was in bed means that it was past his bedtime so the focus is not on the bed itself. The focus in the second sentence is on the bed as a thing or a place.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.