There is more than one way to change that setting. Here is one way: Control Panel | Hardware and Sound | Power Options | Choose what closing the lid does | When I close the lid: from the drop-down list, select Do Nothing for both Battery and Plugged in. A quicker way to reach that settings panel: in Windows 10, Windows key | type lid and at the top of the menu it should say Change what closing the lid does so select that and that panel will open.
I would like to connect my XPS13 to a USB-C docking station and be able to operate it with the lid/screen closed. However, as soon as I close the lid it goes to sleep. How can I change the settings to prevent this from happening and be able to work with the lid closed?
How to prevent XPS13 from going to sleep when closing the lid