Rule: The word however is a conjunctive adverb. As such, it can't act as a conjunction. When used to join independent clauses, however should be preceded by a semicolon and followed by a comma. When used independently, however must be surrounded by commas and is best placed after the words most worthy of special emphasis or somewhere after the verb. Some other conjunctive adverbs (which follow the same punctuation and usage rules) are therefore, nevertheless, furthermore, moreover, in fact, consequently, hence, and accordingly. When using however as a conjunctive adverb introducing a subordinate clause, the whole clause (not the however) requires commas.
Examples:
Correct: He wanted to talk with Lenina; however, he was a real coward.
Correct: The Boers were brave fighters; they were unable, however, to prevent the ultimate victory of the English.
Correct: That sort of knot will slip, however tight you tie it.
Practice deciding if and how to punctuate these sentences:
Resources for further explanation of how to punctuate conjunctive adverbs:
UNE Academic Skills Office's Using However
University of Wisconsin-Madison's The Writer's Handbook's Using Conjunctive Adverbs