If I were Russia, I would aim for recovery of Donestk/Luhansk in it's entirety, then negotiate an exchange of occupied Kherson/Zapo for Ukrainian neutrality from NATO. This isn't satisfactory as Ukraine will still be armed by NATO, but declared end to NATO ascension process would be a win for Russia, and secure Putin's legacy of stopping NATO expansion in Ukraine and his legacy as 'gatherer of Russian-speaking peoples' in DPR/LNR.
If I were Ukraine, I would aim to extend Western aid/support for as long as possible, including Western mercenaries to extend manpower/skills shortages. I don't have high hopes of Ukraine to recover occupied territories, and Ukraine will have no chance at NATO ascension either, so it's best to eventually enter negotiations with Russia at some point in time in future, cede DNR/LNR regions, recover other territories if possible, then pledge neutrality between CSTO and NATO.