Hi
Yes, you can use two external monitors while keeping the laptop lid closed.
First, connect both monitors and press Windows + P, then select Extend.
Next, open Control Panel > Power Options > Choose what closing the lid does. Under “When I close the lid,” set “Plugged in” to Do nothing, then save the changes.
Microsoft’s instructions for the lid setting: https://support.microsoft.com/en-us/windows/experience/power-battery/battery-saving-tips-for-windows
Then close the laptop lid. Both external monitors should remain active.
If only one monitor works, please let me know how the two monitors are connected (HDMI, USB-C, or docking station). Some laptops/docks support only one external display, and a basic HDMI splitter cannot provide two independent extended screens.