Simple method, useful for most types of displays:
if (count < 10000) display.print('0');
if (count < 1000) display.print('0');
if (count < 100) display.print('0');
if (count < 10) display.print('0');
display.print(count);
SSD1306 can get complicated if you are not using a fixed-pitch font, because the amount of space needed for 5 digits will change depending on the specific digits used.