Number of $2\times n$ matrices with numbers $1$-$n$ We have a $2\times n$ matrix that the first row consists of the permutations of numbers from 1 to $n$ and the same thing with the second row. We consider the matrix as accepted if no numbers on the same column or row are the same and no column has the same numbers.
For example:
$$\begin{pmatrix}1&2&3&4\\
    2&1&4&3
    \end{pmatrix}$$
is considered NOT  accepted as the first and the second column have the same numbers ($1$ and $2$).
On the other hand, the matrix:
$$\begin{pmatrix}1&2&3&4\\
    4&1&2&3
    \end{pmatrix}$$
is consider accepted
So how to calculate what is the number of different accepted $2\times n$ matrices we can get using single formula?
 A: Suppose the first row is $1,2,3,...,n$, and there are $x$ ways to arrange the second row. Then there must be $n!x$ total ways to arrange the numbers, obtained by permuting the columns.
Edit: as @Gerry Myerson has noted, $x$ is given by https://oeis.org/A038205. The rest of this answer is an ineffective attempt at deriving the same $x$.

Note also that this matrix can be viewed as a bijective function, mapping values in the top row to values in the same column on the bottom. By looking at smaller matrices, it's apparent that these functions make "chains" of various lengths. For the two matrices you provided, the chains are as follows:
$$\begin{pmatrix}1&2&3&4\\
    2&1&4&3
    \end{pmatrix}\\
1\mapsto2, 2\mapsto1;\quad3\mapsto4,4\mapsto3$$
$$\begin{pmatrix}1&2&3&4\\
    4&1&2&3
    \end{pmatrix}\\
1\mapsto4, 4\mapsto3,3\mapsto2,2\mapsto1$$
With this terminology, we see that the restriction of "no columns with the same numbers" is equivalent to "no chains of length 1", and the restriction of "no columns with the same numbers as another column" is equivalent to "no chains of length 2". Any combination of chains with length $\geq 3$ are thus fair game.
We can describe the making of these chains with a two-step process--split the numbers into groups with at least 3 per group, then line them all up into a chain.
I'm going to hold off on counting the number of ways to split numbers into groups for now, and instead focus on how many ways there are to arrange the elements. Suppose we have a group with $m$ elements. We can arbitrarily choose a number to be our "start", and since the chain circles back it doesn't really matter. Say we take the smallest. For the chain to be the right length, we have to map to the smallest element last. Thus we have $m-1$ choices. For the next element, we can choose any but the smallest and itself, so $m-2$ choices. For the second-to-last, we have two elements left, including the smallest, so we have $1$ option. Thus we have $(m-1)!$ total ways to make a chain out of a group.
Now to split the numbers into groups, we need to a) decide on the group sizes, and b) decide how to assign numbers to the groups. Again, we will do the latter first.
If we have groups $A_1,A_2,...,A_k$ with respective sizes $m_1,m_2,...,m_k$, then there will be
$$\frac{n!}{m_1!m_2!\cdots m_k!}$$
ways to divide the elements among them. Note that this double-counts cases where some groups have the same size; this will be accounted for later. For convienence, we will assume that partitions of $n$ are a non-decreasing sequence $\{m_i\},1\leq i\leq k$. Combining this with our results for the number of possible chains from a group, we multiply by $(m-1)!$ for each $m\in\{m_i\}$. Thus for given sizes $m_1,m_2,...m_k$, we have
$$\frac{n!}{m_1m_2\cdots m_k}$$
Finally we need to count the ways to separate $n$ numbers into various group sizes. This is a partition problem, and does not generally have a nice closed form. It does however work nicely with recurrence relations. Unfortunately, it seems that not only do we need to calculate the number of partitions, but the actual partitions themselves. This is also getting into math that I'm not very familiar with, so the rest of this answer will just describe what you do with each partition once you have it.
To get rid of the double-counting caused by groups having the same size, we just need to divide by the number of permutations of groups in each group size. Defining the function $C(\{m_i\},a)$ to be the number of groups that have size $a$, we can write $C$ and our divisor symbolically:
$$C(\{m_i\},a)=\sum_{i=1}^k\left\{\begin{matrix}1&m_i=a\\0&{\rm otherwise}\end{matrix}\right.$$
$$\prod_{a=1}^nC(\{m_i\},a)!$$
Then we can let $P$ be the set of all partitions $\{m_i\}$ of $n$ with elements at least 3. Symbolically, $P:=\{\;\{m_i\} : \sum_{i=1}^k m_i=n \land \forall i,m_i\geq3\land\forall i<j,m_i\leq m_j\;\}$. Then the total number of arrangements is
$$N=\sum_{\{m_i\}\in P}\frac{(n!)^2}{\left(\prod_{a=1}^nC(\{m_i\},a)!\right)\prod_{i=1}^km_i}$$
This isn't a very satisfying answer, but hopefully this can give you some insight on how to obtain the number computationally, or on how quickly it grows.
If anyone else with more experience with partitions has some insight on how this simplifies, they are of course free to use any part of my solution.
