It is confusing because they are very similar. "Border" is most commonly used as the line that separates two countries.
"Boundary" mostly commonly refers to a line that contains something. Often it is a line that should not be crossed. The boundary of a soccer field. Also personal boundaries - things someone doesn't want to do or talk about.