When I connect, automatically my name appears. How to connect on lichess with a different account, like when a friend wants to use my computer ?
You may need to log out so your friend can login
Click on your username in the top right corner, then Sign out. Then your friend can log in with their username.
Many browsers also support profiles, so you can also create a new user profile there (browser user, not Lichess user). Your Lichess credentials wouldn't be stored there. And then you could just switch profiles whenever your friend is around and want to play from your device.