Confused about the direction in which the bond will break
The reactions happen on different centres because they follow different mechanisms.

Epoxides are actually surprisingly stable. They don’t undergo spontaneous ring-opening reactions by themselves unless the oxygen atom has been protonated previously. That is what the $\ce{H+}$ in reaction path X is there for. After having protonated the oxygen, the ring-opening reaction is charge-neutral and thus releiving the Baeyer strain to generate a tertiary (more stable) carbocation is favourable. This carbocation can be captured by a nucleophile in an $\mathrm{S_N1}$-type mechanism.

This does not happen under basic conditions as removing a negative charge would not help the epoxide opening. However, under these conditions solvent molecules such as methanol are easily deprotonated creating much better nucleophiles. These nucleophiles are then able to attack the epoxide under $\mathrm{S_N2}$ conditions. Hereby, an anion attacks a neutral molecule to generate an anion, so the ring-opening is again charge-neutral. However, $\mathrm{S_N2}$ attacks are more likely to happen on less hindered, primary carbons.

Taking this into account, path X that follows an $\mathrm{S_N1}$ path, generates the most stable carbocation hence the nucleophilic attack happens on the tertiary carbon. Path Y that follows an $\mathrm{S_N2}$ mechanism includes an attack on the less hindered, i.e. primary carbon.