As far as I know, SSMS itself doesn't have built-in automatic code formatting that changes your code style upon saving.
Please check if exist any third-party tools or extensions for code formatting, they might be applying formatting rules automatically.
Best regards,
Cosmog
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".