When using "while" or "whereas" at the beginning of a sentence, place a comma after the first clause. In the middle of a sentence, place a comma before "whereas".
If you start a sentence with the conjunction "when", add a comma after the first clause. The comma is generally unnecessary if the when-clause is the second clause of the sentence.
In the middle of a sentence, we normally use commas to set off the word "too". It is not necessary to place a comma before "too" at the end of a sentence.
Wherever the expression "by the way" comes (at the start, in mid-sentence, or at the end of a sentence), it must be separated by commas or other proper punctuation marks, such as a period, a semicolon, or an em dash.