In classical texts
三代 almost always means the Xia, Shang and Zhou, the dynasties of high antiquity that Confucians took as their model of good government. In everyday speech it means family generations:
祖孙三代 'grandparents, parents and children',
三代同堂 'three generations under one roof'.