Very strictly speaking, there is no law which demands that an employee should give notice before leaving whereas in respect of a workman it is mandatory that the employer should give notice before firing him. In the case of establishments having certified standing orders also what is provided in the standing orders will be binding on both the employer and the employees. But in all other cases and in practice we all follow a rule that what is there in the letter of appointment with regard to notice period should be followed. As such if your appointment order speaks that you have to serve two months notice then you are bound to serve it, failing which the employer can demand salary in lieu of notice period.
Now coming to the scenario wherein the employee has resigned saying that he may be relieved on a date after two months, implying that he will be with the company for two months' notice period. Now thinking that a resigned person will no longer be putting his efforts to take care of the work the HR decides that he may be asked to go earlier. In this scenario, what the company should do is to pay the remaining months' salary and relieve him now. It is not that the employee can be asked to get relieved immediately without compensating for the two months' notice that he has served.It may be true that the resigned employee will not be engaged properly, but what the orders/ appointment letter speaks cannot be diluted for the employer. Therefore, the right thing that a genuine HR should do is to relieve after paying salary for the entire unserved notice period, say 2 months.