A picture paints a thousand words...so here’s a picture:
The picture on the left shows what happens when you hit your ball out of play and have to drop it. Notice that the first shot location is shown in red, this will happen when you select the lie position for your shot as ‘Penalty’. The second ball location is designated as ‘3’ or the third location, taking into consideration the added penalty stroke.
On the right, you have what happens when a ball is hit immediately out of bounds from the tee. That ball is lost to the wilderness, so you’ll have to play the shot again from the tee taking a penalty. The second location you play from will be shown as your third location, taking into consideration the additional stroke.