Even though my knowledge of english is limited, my grammar book has the information about the use of "however", so I think it's safe to reply to your question according to my book.
However is adverb; it can be used to link the sentences, so you can put it in the middle of two sentences to form a compound sentence (it's a conjunctive adverb).
However can be put in many places in the sentence and here are its position and its needed punctuations (according to my book).
1. ID; however, ID (He was annoyed; however, he kept quiet.)
2. ID. However, ID (He was annoyed. However, he kept quiet.)
3. ID. ID, however. (He was annoyed. He kept quiet, however.)
4. ID. ID (subject), however, v/o/c. (He was annoyed. He, however, kept quiet.)
But is co-ordinate conjunction, so its use is almost the same as however but however is mostly used in more formal situation.
Hope this helps.