How do I terminate the old connection when a user of the same account login again?
You probably want to use a Logon Trigger to manage this. This specific part of the docs linked above mentions how you can limit the number of sessions for a specific Login:

You can use logon triggers to audit and control server sessions, such
as by tracking login activity, restricting logins to SQL Server, or
limiting the number of sessions for a specific login.

The first example in the docs is close to what you want, except it'll rollback the newer logins. If you want to kill the older logins you can use the login_time column of sys.dm_exec_sessions and kill the older sessions for that specific login_name.