The MacBook Air M4 supports up to two external monitors simultaneously, in addition to its built-in display, so using two separate external screens should be possible with the right connection method.
Apple's official specifications confirm support for two external displays at up to 6K resolution at 60Hz each: Apple Support – How many displays can be connected to MacBook Air.
The important distinction is between mirroring and extended desktop.
Mirroring means both monitors display the same content, whereas an extended desktop allows you to have different windows or applications open on each monitor and drag them between screens.
If both monitors currently show the same image, first go to Apple menu >> System Settings >> Displays and check whether macOS recognizes both monitors separately and allows you to configure them as an extended desktop.
Apple's guide explains how to connect external displays to a MacBook Air and configure display settings.
If macOS detects only one external display, the issue may be the dock or hub rather than the MacBook itself.
Some docks and hubs use DisplayPort MST (Multi-Stream Transport) to drive multiple monitors.
Although this works for extending displays on many MS Windows computers, macOS does not support MST for extending the desktop across two independent monitors in the same way.
Consequently, both monitors may mirror each other, or only one may be detected.
To troubleshoot, try connecting each monitor directly to a separate USB-C/Thunderbolt port on the MacBook Air using compatible cables or adapters.
This helps determine whether the dock or hub is the limitation.
Apple also recommends connecting a display directly to the Mac when troubleshooting a display connected through a dock or hub. See Apple Support – If your external display is dark or low resolution.
Next, check the exact model and specifications of the dock or hub to determine whether it supports two independent external displays on macOS.
Depending on the model, you may need a compatible Thunderbolt dock or a DisplayLink-based dock with the appropriate macOS software installed.
You can also follow Apple's troubleshooting steps if a monitor is not detected, including disconnecting and reconnecting it, checking the cables, using the Detect Displays option where available, and installing applicable macOS updates.
The MacBook Air M4's 32GB of memory is not a limitation here, and you do not need to close the laptop lid to use two external displays. The most useful next step is to identify the exact dock or hub model and check whether macOS recognizes one or two external displays in System Settings.
Relevant Apple resources: