The structure of an elementary sentence in German is Subject + Verb + Object. Thanks to German cases like Accusative and Dative, you can easily start your sentence with the object and Germans often do that. However, your verb will stay at the second position no matter if you start your sentence with the Subject (Nominative case) or not. The same applies when it comes to forming a question by using a question word.
For instance:
Peter hat Urlaub.
(Peter has a vacation.)
Wer hat Urlaub?
(Who has vacation?)
Ihr schreibt einen Test.
(You write a test.)
Was schreibt ihr?
(What do you write?)
In der Küche kocht Jan eine Suppe.
(Jan cooks soup in the kitchen.)
Wo kocht Jan eine Suppe?
(Where does Jan cook soup?)