Question: I want to write a command.

This is the example the commands should achieve:

```
\begin{alignat}{1}
Hello \\
Hello two \\
Hello three
\end{alignat}{1}

```

This should the commands look like:

```
\mycommand {
\command{Hello}
\command{Hello two}
\command{Hello three}
}

```

\mycommand has one argument and this will include a list of commands.
It will put a `\begin{alignat}{1}` before all commands and a `\end{alignat}{1}` after all commands. Between each of the commands it will insert a `\\` (after the last command no `\\` is inserted and this is the difficult part).

In this example the `\command` is

```
\newcommand{\command}[1]{#1}

```

The Question is how do i write `\mycommmand`

Answer: 
Here is an implementation of `\mycommand` and `\command` that provides what you're after:

![enter image description here](https://i.stack.imgur.com/TjpL1.png)

```
\documentclass{article}
\usepackage{amsmath}
\begin{document}

Some text before.
\begin{alignat}{1}
  \text{Hello} \\
  \text{Hello two} \\
  \text{Hello three}
\end{alignat}
Some text after.

\noindent
\hrulefill

\newcommand{\mycommand}[1]{%
  \begin{alignat}{1} #1 \end{alignat}%
}%

Some text before.
\mycommand{
  \text{Hello} \\
  \text{Hello two} \\
  \text{Hello three}
}%
Some text after.

\noindent
\hrulefill

\makeatletter
\renewcommand{\mycommand}[1]{%
  \begin{alignat}{1} #1\null \end{alignat}%
}%
\def\@afterfi#1\fi{\fi#1}%
\newcommand{\command}[1]{\text{#1} \@ifnextchar\null{}{\\}}%
\makeatother

Some text before.
\mycommand{
  \command{Hello}
  \command{Hello two}
  \command{Hello three}
}%
Some text after.

\end{document}

```

An additional `\null` token is inserted at the end of `\mycommand`'s argument, and used as a check in `\command` using [`\@ifnextchar`](https://tex.stackexchange.com/q/57788/5764).
Doing it with just `xparse` facilities is complicated. Here's an implementation using some functions from `expl3`:

```
\documentclass{article}
\usepackage{amsmath,xparse}

\ExplSyntaxOn

\seq_new:N \l_mycommand_lines_seq
\seq_new:N \l_mycommand_output_seq

\NewDocumentCommand{\mycommand}{m}
 {
  \seq_set_split:Nnn \l_mycommand_lines_seq { \command } { #1 }
  \seq_pop_left:NN \l_mycommand_lines_seq \l_tmpa_tl
  \seq_set_map:NNn \l_mycommand_output_seq \l_mycommand_lines_seq
   { \exp_not:n { \command { ##1 } } }
  \begin{align}
  \seq_use:Nn \l_mycommand_output_seq { \\ }
  \end{align}
 }

\cs_generate_variant:Nn \tl_if_blank:nT { x }
\ExplSyntaxOff

\newcommand{\command}[1]{#1}

\begin{document}

\mycommand{
\command{Hello}
\command{Hello &= two}
\command{Hello &= three}
}

\end{document}

```

The input is split at `\command` tokens; white space will be automatically trimmed. The first element in the sequence is popped off, as it will be empty. Then the sequence is mapped to reinsert `\command` before the items (but a different macro could be used. Then the resulting sequence is *used* with `\\` in between any two items.

![enter image description here](https://i.stack.imgur.com/dBUUM.png)