How to choose tax residency status for outbound person

Hi everyone, wondering if anyone has been in the same boat as me. I was a PhD student in the US from 2017-2023. I had filed the US income based tax returns for the first five tax years as non-resident alien and then for 2022 as resident alien. In early 2023 I returned to India and took up a job; I will file tax return in India for FY 2023. I would meet the substantial presence test in US for 2023 but I have been in India for more than 7months too. I am wondering what would be my tax status for 2023 when filing return in US? There is something called dual-status (https://www.irs.gov/individuals/international-taxpayers/taxation-of-dual-status-individuals) and IRS says to file 1040-NR and write “Dual-status return” on top but I am not too confident about this.
Thanks in advance for any help!