A home router knows the names of the devices on your network; the public upstream does not. In AdGuard Home’s upstream list, square brackets send one domain to its own server.
In Settings, DNS settings, Upstream DNS servers, put the special line next to your normal upstreams:
https://dns.quad9.net/dns-query
[/home.example/]192.0.2.1
[/corp.example/lab.example/]203.0.113.53
Anything ending in home.example now goes to the router at 192.0.2.1, and both company domains go to 203.0.113.53. Everything else uses the first line. You can list several domains between the slashes.
There is a special value #, which the docs describe as “use the default servers”. It is how you make an exception inside an exception:
[/example.com/]203.0.113.53
[/www.example.com/]#
Here example.com goes to the internal server, except www.example.com, which goes to the normal upstreams.
One thing I’d check is reverse lookups. For client names in the query log, AdGuard Home has a separate private reverse DNS setting; pointing that at your router as well gives you names instead of bare addresses.
If you edit AdGuardHome.yaml instead of the web UI, stop the service first. The docs warn a running AdGuard Home overwrites the file.
Further reading: AdGuard Home configuration: upstreams for domains
Going deeper: Guide: AdGuard Home with Unbound: resolve DNS yourself instead of asking Cloudflare or your ISP