I have a main breaker box that feeds a panel in my basement. This basement panel then feeds a panel in my backyard garage. The panel in the backyard has neutral and ground wires mixed on the 2 bus bars. I have always thought the basement panel and backyard panel were sub panels to the main breaker box. The backyard garage panel does have it's own grounding stake just outside the building. Does this make it then a main panel and not a subpanel even though it is fed from a sub-panel in the basement. Just trying to understand what all constitutes the designation of main panel and sub-panel.
A main panel (or service entrance panel) is simply a panelboard that contains the main service disconnect for a property -- this can be up to six circuit breakers in a rule-of-six (split bus) panel, but is more commonly a single main circuit breaker or fused disconnect (such as a pullout).
Or in other words: the service from the electrical utility enters the main electrical panel for a property, and all other panels on that property are subpanels, as long as there is not a second utility service or a transformer on the property. There are also other special cases such as multiple section main panels, but they're beyond the scope of this answer.
There are two answers depending on which version of the NEC was in force when the electrical service install. In many versions the main panel is bonded (ground and neutral tied together. In current versions of the NEC bonding has been moved to the transformer only. In really old versions sub panels may also be bonded (because they did not have a ground connection to the main panel). So the end result is that in modern and ancient systems the only distinction between main panels is that shutting off power to the main panel also shuts off all the panels it feeds, however for most installed systems there is also differences in grounding, specifically one arcane case in which power enters a property at the back of the house, where there is a main panel (bonded, ground rod, no ground from pole) which feeds a sub panel in the basement (not bonded, ground wire from the main panel, may or may not have it't own ground rod) which feeds a detached garage which has it's own main panel (bonded, ground rod, ground not connected to the house). this presents odd challenges in cross building circuits (yard light switched by three-way switches is required to have one and only one ground connected to both buildings ground while not connecting the grounds between buildings, which is why we installed a motion detector instead). Fortunately the new rules no longer allow this.