To automatically achieve this, You can create a pipeline for the submodule repo. And set a pipeline trigger in YAML pipeline of the owning repo, which will be triggered on the completion of the submodule's pipeline.
In the YAML pipeline of the owning repo add a script task to run the command git submodule update --remote --rebase
. Please check out below detailed steps.
1, Create a pipeline(recommended Classic UI pipeline) with an empty agent job(no tasks), which makes the pipeline always complete with success. And enable continuous integration, so that the commits to the submodule repo will always trigger this pipeline.

2, Add pipeline resources trigger for the YAML pipeline of the main repo. see document Pipeline resource for more information. see below example:
resources:
pipelines:
- pipeline: submoduleTriggerPipeline
source: TestConnection
trigger: true
3, Add a script task to run git command in the yaml pipeline of the owning repo. See below script example:
steps:
- powershell: |
cd $(system.defaultworkingdirectory)
#get the latest submodule source on the agent.
git submodule update --remote --rebase
#optionally run below git commands to update the owning repo with the submodule's changes
git config --global user.email "user@email.com"
git config --global user.name "name"
git add .
git commit -m "commit the submodule's changes to owning repo"
git push https://$(System.Accesstoken)@dev.azure.com/azureOrgName/ProjName/_git/submodule HEAD:$(Build.SourceBranchName) -q
So that when commit is made to submodule repo, submodule pipeline(created in the first step) will be triggered and complete successfully, then the pipeline of owning repo will be triggered on the completion of the submodule's pipeline. And then above script task will be executed to pull the latest submodule code and push back to owning repo with the submodule's changes.