When you connect lines, lines are drawn between neighbouring endpoints.
Select two or more lines.
Right-click and choose Shape - Connect.
To create a closed object, right-click a line and choose Close Object.
You can only use the Close Object command on connected lines, Free-form Lines and unfilled Curves.