Spaces after and before | are deliberate. Template must render okay with them.

1 page
{{Distinguish| PAGE1 }}

{{Distinguish}}

{{Distinguish/sandbox}}

2 pages
{{Distinguish| PAGE1 | PAGE2 }}

{{Distinguish}}

{{Distinguish/sandbox}}

3 pages
{{Distinguish| PAGE1 | PAGE2 | PAGE3 }}

{{Distinguish}}

{{Distinguish/sandbox}}

4 pages
{{Distinguish| PAGE1 | PAGE2 | PAGE3 | PAGE4 }}

{{Distinguish}}

{{Distinguish/sandbox}}

4 pages with piping
{{Distinguish| PAGE1 (disambiguation)|PAGE1 | PAGE2 (disambiguation)|PAGE2 | PAGE3 (disambiguation)|PAGE3 | PAGE4 (disambiguation)|PAGE4 }}

{{Distinguish}}

{{Distinguish/sandbox}}

Custom text
{{Distinguish|text=[[PAGE1]]}}

{{Distinguish}}

{{Distinguish/sandbox}}

More complicated custom text
{{Distinguish|text=[[PAGE1]], another thing with the same name}}

{{Distinguish}}

{{Distinguish/sandbox}}