For those who do not have a background in classical theory here is an explanation of the fugal layout.
The fugue is made up of a number of voices, unlike a homophonic classical style piece where the harmonies are self-sufficient, in contrapuntal music they are simply the consequence of multiple voices working together. This requires specific rules to do with how the voices relate to each other, but this is not what we wish to discuss here. The important thing to remember is that in the fugue, the number of notes that can occur simultaneously is fixed by the number of voices. Of course, given that the fugue is primarily a keyboard form, the rules governing the deployment of voices need not be strict.
The fugue is built entirely from two melodic phrases. These are the subject and the counter-subject. The subject is played once, in one voice, it is then played again in a different voice, but this time starts either one fifth higher or one fourth lower than its original entry. The subject may be repeated literally in the dominant key, or it may be altered to remain within the original key. The counter-subject is played by the voice which originally had the subject, whilst the second voice plays the subject. This process continues, with entries alternating between tonic and dominant, until every voice has played the subject. Once this has happened the exposition is complete.
Once the exposition has finished, the development begins. In the development, the composer may compose freely with the material which has already been introduced in the exposition. The contrapuntal techniques available to them include inversion, retrograde, stretto, which is where one voice enters with the subject before another voice has completed its entry, amongst many others. Modulation is usually achieved with a sequence, where a musical fragment is repeated and moved by steps with each repetition. When an important key is reached the subject is often played in full, but rarely without some kind of contrapuntal treatment. In the development, the subject and counter-subject are inevitably broken down into their most microscopic elements, and, if the fugue is well-written, the possibilities of these elements are thoroughly explored.
The fugue usually concludes with a clear statement of the subject in the original key, although once again, this will probably not be without some kind of contrapuntal treatment. This is the basic layout of the fugue, but, as history has shown, few of these guidelines are actually rules and the general layout of the fugue, along with its basic techniques, can be adopted by almost any style of music. The fundamental principle of the fugue is that it should attempt to explore the polyphonic possibilities contained within its primary themes, and this principle can be applied almost universally.
Feel free to correct me on anything i got wrong.
One last thing to remember is that a fugue is not a canon, that is, a piece where the voices copy each other literally and continuously.