Tim looked very happy, while Tom looked very sad.
Comma or not?
Assuming it is a contrastive "while", yes, use a comma. If it was a concurrent "while" then you would not use a comma, but this meaning seems unlikely to be intended, to the point where omission of a comma may look more like a mistake anyway.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
Assuming it is a contrastive "while", yes, use a comma.
If it was a concurrent "while" then you would not use a comma, but this meaning seems unlikely to be intended, to the point where omission of a comma may look more like a mistake anyway.