Well, it is clear that you have to complete 24 months of your agreement. The point is, you can give a two-month notice period, including your agreement period. After that, you can only give a notice period if you want to leave. So, it's very simple. Just check out the terms and conditions of your agreement to see what they have mentioned about renewal or notice period. You'll get a clear picture of this issue.
In my point of view, if the notice period is mentioned, then you have to first complete your 24 months, and then you can put in your notice period for the next two months. Because 24 months is your agreement period, so your notice will not work during that time period. Now, the rest is the relationship between you and your employer. If it is good and your reason to quit is unavoidable, then you can sit with the relevant authority and try to convince them. Try to settle down according to your terms. If not, then with mutual settlement, try to minimize the notice period and be careful about the discussion session. Whatever is discussed, just email them and get approval on that. Better yet, get a hard copy of that mutual settlement so that in the end, you won't face any difficulties in obtaining a relieving or experience letter.
If the agreement is for a specific period, i.e., 24 months, then giving notice after 24 months is not relevant because the agreement becomes null and void after the completion of the term. The termination clause is given and is applicable only if either party wants to terminate the agreement in between the term. In essence, the Notice Period is required if either party does not want to continue or move forward with the agreement.