@kumaravelu , For SCOM 2012 and 2019 coexistence, it seems not supported.
https://learn.microsoft.com/en-us/system-center/scom/deploy-upgrade-overview?view=sc-om-2019#supported-coexistence
After doing more research, I find although it is not supported, it works.
https://social.technet.microsoft.com/Forums/en-US/a8fad6e4-df1d-4930-9d77-6a119880e9b8/multihome-scom-agent-2012r2-amp-2019-possible?forum=operationsmanagergeneral
For your question, based as I know, we can upgrade the agent by installing the latest version. For the uninstall action, it will do automatically when we install the latest one. Here are the methods we can try the upgrading.
https://learn.microsoft.com/en-us/system-center/scom/deploy-upgrade-agents-parallel?view=sc-om-2019
https://learn.microsoft.com/en-us/system-center/scom/deploy-upgrade-agents?view=sc-om-2019
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.