Deductions & credits

Hello for next years taxes, when i get the return for 2023, would it be better to put down 7/31/2022 to 7/31/2023? 7/31/2023 is when I'm leaving, but I saw you said 9/2022 to 9/2023, and that seemed like that would place me with two months not in country and would throw it off. I apologize, I'm ignorant to this, and I appreciate all your help, I just wanted to grasp a real understanding.