One should always capitalize the main words and the first and last words of a title
But one should never capitalize articles, or prepositions and conjunctions with fewer than five letters, when they occur in the middle of a title
Prepositions and conjunctions with five or more letters should be capitalized in any text.