In book II (chapter 1) of his An essay concerning human understanding Locke talks quite a bit about whether the soul always thinks. Why is this such an important issue to him that he spends multiple pages on it? And could someone explain why a sleeping man who thinks without knowing it, is divided in two people?
The apparent need of the soul to always think, that Locke struggles with, seems to reflect the influence of Descartes (Locke was born in 1632, 36 years after Descartes). It was Descartes's influential thesis that the soul just is a thinking substance. That is, that the whole being of the soul consists in thinking. And this seems to entail the (apparently absurd conclusion) that the soul exists only when it thinks. So that if the soul exists continuously, it must think continuously!
And as to the division of the person during sleep, Locke derived it from the assumption that personal identity requires self-awareness. Since the waking person is presumably not self-aware of the sleeping person's experiences, and vice versa, they must be two distinct persons.
Socrates the man, consisting of body and soul, when he is waking, are two persons: since waking Socrates has no knowledge of, or concernment for that happiness or misery of his soul, which it enjoys alone by itself whilst he sleeps, without perceiving anything of it; no more than he has for the happiness or misery of a man in the Indies, whom he knows not. (An essay concerning human understanding Book II Ch I §11)