alkanes by counting from the end carbon of the longest chain closest to the branch.
alkenes and alkynes by giving the multiply-bonded carbons the lowest possible numbers and numbering the carbon bearing the branch accordingly.

The molecule at the right is 2-methylpentane.
Numbers are used to indicate branch positions and the location of the double bond
only if required to unambiguously specify the structure. CH
3CH=CH
2 is propene not prop-1-ene.

The molecule at the right is methylbutane (not 2–methylbutane).