A section of A guide to German
When a sentence begins with the subject and contains only finite verbs and no relative clauses, the words are placed in the same order as in English: subject-verb-object. Thus "I know your son" is ich kenne Ihren Sohn, each word corresponding to the English word in the same position.
When a sentence or clause begins with something other than the subject, the subject-verb order is inverted to verb-subject. Thus "last year I went to Italy" is letztes Jahr bin ich nach Italien gefahren, not letztes Jahr ich bin...; "slowly he stood up" is langsam stand er auf; "soon the trees will die" is bald werden die Bäume sterben. This is still used in English in a few standard constructions, and in old or poetic writing: "'Don't do it,' said Michael", or "Green Grow the Rushes". Likewise in German: "Mache das nicht", sagte Michael.
The result of inverting the verb is that it remains in second place in the sentence, pushing the subject into third place. In "last year I went to Italy", the verb, "went", comes third, after "last year" and "I". In letztes Jahr bin ich nach Italien gefahren, the verb, bin, is in second place, after letztes Jahr but before ich. Keep in mind that the verb is the second concept in the sentence (in the sense that "last year" is a concept), not necessarily the second word.
There are four important conjunctions which do not invert the verb: und ("and"), aber ("but"), oder ("or") and denn ("for", in the sense of "because"). "I know him, but I don't trust him" is ich kenne ihn, aber ich vertraue ihm nicht; "I can go or I can stay" is ich kann verlassen oder ich kann hierbleiben.
Infinitives and participles
These go to the end of the clause, rather than coming before the noun as in English. We say "I buy the house" and "I will buy the house", with "buy" coming before "house" in both sentences, but in German the infinitive goes to the end. Thus "I will buy the house" is ich werde das Haus kaufen; "I have bought the house" is ich habe das Haus gekauft. This sounds a bit strange to English ears but it is absolutely imperative; it would sound equally strange to a German to hear ich habe gekauft ein Auto or wir müssen verlassen das Land.
Relative and subordinate clauses
Relative clauses are those containing a relative pronoun, such as "The car that I bought last month"; subordinate clauses are those containing a word such as "since" (seitdem), "after" (nachdem), or "because" (weil); in both, as far as German is concerned, the finite verb must go the end of the clause. "I'm happy because I have a new car" is ich bin glücklich, weil ich ein neues Auto habe; "before I go abroad, I must give you something" is bevor ich ins Ausland reise, muss ich dir etwas geben; "the girl who plays football" is das Mädchen, das Fußball spielt. Yes, in German you must say "because I a new car have"; get used to it.
What if the relative or subordinate clause already contains an infinitive or participle? Both the finite verb and the infinitive or participle go to the end, but the infinitive or participle comes first. Thus "I'm happy because I've bought a new car" is ich bin glücklich, weil ich ein neues Auto gekauft habe; "the girl who can play football" is das Mädchen, das Fußball spielen kann.
What if the clause contains a finite separable verb, so that the verb prefix goes to the end? In this case, the prefix and the rest of the finite verb join up at the end of the sentence, as one word, so "I always lie in bed before I get up" is ich liege immer im Bett, bevor ich aufstehe (finite form of aufstehen); "the guy who's washing up" is der Kerl, der abwäscht (from abwaschen).
Infinitives, participles and finite verbs in subordinate and relative clauses should always go to their correct positions no matter how many of them there are. If you say "I'm happy, because I'll [I will] be able to buy a new house", the subordinate clause contains two infinitives: "be able to" and "buy", and a finite verb: "will". In German they must all go to the end of the clause: ich bin glücklich, weil ich ein neues Haus kaufen können werde; "I'm happy, because I a new house buy be able to will".
You can even get four verbs at the end of a clause. The verb lassen, "to let", can be used with infinitives to mean "to have (something) done", so bauen lassen is "to have built" (as in "I'm having a house built for me"), schreiben lassen is "to have written", etc. "I'm happy because I should soon be able to have it built" is, in German, ich bin glücklich, weil ich es bald bauen lassen können soll - "I'm happy, because I it soon have built be able to should". In practice, German speakers don't always follow the rule precisely in situations like this, and the above might come out more like ich bin glücklich, weil ich es soll bauen lassen können. In casual speech, people sometimes neglect to put the verb at the end of the clause even in simpler sentences - they might say weil ich habe kein Auto, not weil ich kein Auto habe.
Questions are formed by reversing the order from subject-verb to verb-subject. In English we do this for a few verbs, such as "to have", "to be", auxillaries and modals - for example, "are you well?", "has he done it yet?", "will we ever know?", "can they sing?". German does this for all verbs - there is no equivalent of the "do" in "do you know?" or "does he know?". Thus "do you play football?" is for the informal singular, spielst du Fußball?; for the informal plural, spielt ihr Fußball?; and for the formal (singular and plural), spielen Sie Fußball?.
The German equivalent of "not" is nicht. To negate a verb - for example, to turn "I sing" into "I don't sing" - nicht comes after the finite verb: ich singe/ich singe nicht. There is no equivalent of the "do" in "I do not". When the verb is transitive (i.e. it has an object), the negation can come before or after the noun, but often one position would seem more natural than the other. "I don't play football" could be ich spiele nicht Fußball or ich spiele Fußball nicht (or alternatively ich spiele keinen Fußball; kein, meaning "no" as in "no luck", is used very commonly). For "he is not happy", er ist nicht glücklich would sound a lot better than er ist glücklich nicht.
The negation nicht comes before infinitives and participles, so "I won't be able to buy a house" is ich werde ein Haus nicht kaufen können - or ich werden kein Haus kaufen können. It also comes before a separated prefix, so "he's not getting up" is er steht nicht auf. However it comes after short words like pronouns, so "I don't know him" is ich kenne ihn nicht and "she doesn't have that" is sie hat das nicht.
Inversion for emphasis
However ironic it may seem after all the bizarre rules for moving verbs around, German also has in some respects more freedom of word order. Because of case markers on qualifiers and adjectives, it is possible to reverse the subject-object order without making it ambiguous which is the subject and which is the object. The classic blackboard example is den Briefträger beißt der Hund - "the dog bites the postman", with the object (the postman) coming first but distinguished by the accusative article den.
This shifting of order can be used for emphasis. If someone says Möchten Sie ein Brötchen, "Would you like a roll?", you can say Nein, einen Kuchen hätte ich gern - "No, I'd like a cake". In this example, the object, einen Kuchen, is masculine, so it inflects for case. The case distinction is usually indicated by at least one word, particularly when pronouns are involved, as in nein, eine Coca hätte ich gern - "no, I'd like a Coke" - ich is nominative. You can do this to a certain extent in English, as in "that one I like the most", but German does it more freely.
Remember than when the subject-object order is inverted, the verb still comes second, between the two: den Briefträger beißt der Hund.
German doesn't like to split finite verbs. In English it's perfectly alright to say "I often eat strawberries", splitting "I" and "eat" with the adverb "often", but that doesn't happen in German - rather you would say ich esse oft Erdbeeren or oft esse ich Erdbeeren, keeping the subject and verb together.
There is another rule which states that adverbs of time should come before adverbs of place. I learnt this in school as "Time-Manner-Place", but this is a bit of a misnomer as you can move things around for emphasis. Generally though it is safe to say that adverbs of time - such as "yesterday", "at nine o'clock", "every afternoon" - should come before adverbs of place. For example you would say ich bin gestern nicht in die Schule gegangen, not ich bin in die Schule nicht gegangen gestern, for "I didn't go to school yesterday". Of course you could also put gestern at the front for emphasis, as in English: gestern bin ich nicht in die Schule gegangen.