This is an informal comment, a set of examples to visualize the way that a native Spanish speaker thinks about the verb estar. The rules may appear in common bibliography.
Estar is so different for us from Ser. Ser is the character of the things. Estar is the state of the things. In English, these two concepts are blended in the to/be verb.
Estuve is used when you were in a place that references a single point in time or you are declaring a punctual action of being in a place in the past. Estaba is used when you want to talk about a context that is continuous in time, a determinant of the situation that you are talking about, determining 'where you were", or what you were doing. Examples:
Yo estaba solo ayer en el examen: I was alone yesterday during the test.
Yo estuve sólo en el examen: I was the only one in the test.
Yo estuve con tu amiga: I was with the girl that is your friend. In some informal context this may mean that he kissed or had relations with your friend.
Yo estuve en casa todo el día: I was at home all the day.
In this sentence the speaker is stating the fact of being at home, regardless of the time interval, emphasizing the fact and not the circumstance (la circunstancia). If you said Yo estaba en casa, that would be translated as, "I was staying at home."
The emphasis is now on the circumstance, and this sentence may be used as an excuse in an interrogation to justify that you were not in a place outside home during a specific interval of time.
But "Yo estuve en casa" may be used for the same purpose, but excusing yourself for a specific time and not an interval.
Suppose that you were crying all day and go to a friend, you say hi and then say: I was crying all day. It is a correct way to start a Conversation, but in Spanish...You can say: Estuve llorando todo el día. And end your sentence - that works.
But if you say: Estaba llorando todo el día, it would be improper speech. This is because when you use the second way the listener will be waiting for you to complete the sentence because you are making more emphasis to the circumstance of having been in tears, than the fact of crying. Then you must close the idea and say why you mentioned that you were crying all day.