For Windows Laptops:
Power and Sleep Settings > Additional Power Settings > Choose what closing the lid does > Do Nothing (On battery and/or Plugged in)
For macOS Laptops:
System Preferences > Energy Saver > Slider set to Never
For Windows Laptops:
Power and Sleep Settings > Additional Power Settings > Choose what closing the lid does > Do Nothing (On battery and/or Plugged in)