In logic, we are only interested in sentences that can figure as a premise or conclusion of an argument. So we will say that a sentence is something that can be true or false.
You should not confuse the idea of a sentence that can be true or false with the difference between fact and opinion. Often, sentences in logic will express things that would count as facts— such as ‘Kierkegaard was a hunchback’ or ‘Kierkegaard liked almonds.’ They can also express things that you might think of as matters of opinion— such as, ‘Almonds are yummy.’
Also, there are things that would count as ‘sentences’ in a linguistics or grammar course that we will not count as sentences in logic.
In a grammar class, ‘Are you sleepy yet?’ would count as an interrogative sentence. Although you might be sleepy or you might be alert, the question itself is neither true nor false. For this reason, questions will not count as sentences in logic. Suppose you answer the question: ‘I am not sleepy.’
This is either true or false, and so it is a sentence in the logical sense. Generally, questions will not count as sentences, but answers will.
‘What is this course about?’ is not a sentence. ‘No one knows what this course is about’ is a sentence.
Commands are often phrased as imperatives like ‘Wake up!’, ‘Sit up straight’, and so on. In a grammar class, these would count as imperative sentences. Although it might be good for you to sit up straight or it might not, the command is neither true nor false. Note, however, that commands are not always phrased as imperatives. ‘You will respect my authority’ is either true or false— either you will or you will not— and so it counts as a sentence in the logical sense.
‘Ouch!’ is sometimes called an exclamatory sentence, but it is neither true nor false. We will treat ‘Ouch, I hurt my toe!’ as meaning the same thing as ‘I hurt my toe.’ The ‘ouch’ does not add anything that could be true or false.