Use GroupBy.ffill with DataFrame.sort_values and DataFrame.sort_index for NaN
s to end of groups:
df['C'] = df.sort_values(['A','B','C']).groupby(['A','B'])['C'].ffill().sort_index()
print (df)
A B C
0 aa xx 2
1 bb yy 3
2 cc zz 8
3 aa xx 2
Another solution with forward and back filling per groups:
df['C'] = df.groupby(['A','B'])['C'].apply(lambda x: x.ffill().bfill())