"Were you" or "You were"
Solution 1:
There are two kinds of questions in English.
One kind reverses the subject and the first auxiliary verb. It uses auxiliary do.
That kind is the real question, and is a complete sentence -- an independent clause.
- How long were you unavailable?
- When will she be coming to the party?
- When did he finish his coffee?
The other kind does not reverse the subject and auxiliary verb. It doesn't use do, either.
That kind is not a real question, nor an independent clause. It is a dependent clause.
- They want to know [how long you were unavailable].
- He wants to know [when she will be coming to the party].
- I want to know [when he finished his coffee].
Notice that there are no question marks here, because these are not questions; they are Object Complement clauses with the Embedded Question complementizer. Each embedded question in the examples above is the direct object of the verb know.
So if you ask a real question, be sure to use the first type, with the inversion.
Many if not most of the questions asked on ELU.SE are incorrect, for this reason.
If you want to get a good answer, ask a good question.
(By the way, this question has been asked and answered here dozens of times before.
From now on, why not just link to this answer and save time?)