By default, the query and query results in SQL Server Management Studio (SSMS) are displayed in the same query editor tab:
Query results can be set to open in a separate tab together with messages and execution plans.
Click Tools -> Options
In Options window choose Query Results -> SQL Server -> Results to Grid or Results to Text
Check "Display results in a separate tab"
You can also check "Switch to results tab after the query executes"
Open new Query editor window to use this settings: