You need to use ListLayers to iterate the layers:
import arcpy
mxd = arcpy.mapping.MapDocument(r"O:\Solar Databases\OSER Solar\Projects\(MO) Berntie Land Status.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Main Map")[0]
for lyr in arcpy.mapping.ListLayers(mxd, df): # List the layers in this data frame
#x = 0 # if you set x=0 here then each iteration will start at 0 and finish at 1
name = lyr.name
print name
#x = x+1 # the use of x is redundant
del mxd
Don't try to index the layer list directly, the order is arbitrary and not guaranteed to be in the same order in multiple calls. The direct indexing of ListDataFrames is acceptable provided there is only 1 data frame called "Main Map" - the order of 1 object, although arbitrary is still 1 object.
To work with layers by index you can do it this way:
import arcpy
mxd = arcpy.mapping.MapDocument(r"O:\Solar Databases\OSER Solar\Projects\(MO) Berntie Land Status.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Main Map")[0]
AllLayers = arcpy.mapping.ListLayers(mxd, df)
for x in range(len(AllLayers)):
lyr = AllLayers[x] # layer from list by index
name = lyr.name
print name
del mxd
Using the range() function you create a list [0,1,2..n], where n is the number of items in the list minus 1 - remembering lists are 0 based (the first item is 0, the last is len(list)-1). Get your list of layers once and then access it many times, that way you can guarantee the order hasn't changed during an iteration.
df
to the first element of a list, then try to iterate on the single element. 2) You reinitialize thex
variable to zero with each iteration of the loop. Also, the canonical form of "increment x by one" isx += 1