when does baby generally rotate?

My past two ultrasounds (13 and 19w), baby was lying sideways. I was just wondering when they generally run out of room to lie that way and shift to either head down or some form of breech.