$A$ and $B$ are two opposite vertices of an $n \times n$ board. Within each small square of the board, the diagonal parallel to $AB$ is drawn, so that the board is divided in $2n^{2}$ equal triangles. A coin moves from $A$ to $B$ along the grid, and for every segment of the grid that it visits, a seed is put in each triangle that contains the segment as a side. The path followed by the coin is such that no segment is visited more than once, and after the coins arrives at $B$, there are exactly two seeds in each of the $2n^{2}$ triangles of the board. Determine all the values of $n$ for which such scenario is possible.
1. **Restate the Problem in Terms of Graph Theory:**
   Consider a coordinate grid such that \( A \equiv (n, 0) \), \( B \equiv (0, n) \), and the other two corners of the board are \( (0, 0) \) and \( (n, n) \). The problem can be restated as follows:
   - Color some of the sides of the triangles such that:
     1. In each triangle, exactly two sides are colored.
     2. At each vertex of the grid, an even number of colored edges meet, except for \( A \) and \( B \), where an odd number of colored edges meet.

2. **Initial Assumptions and Conditions:**
   - Assume the scenario is possible for some \( n \).
   - Since exactly two edges meet at \( (0,0) \), they are either both colored or not colored. Due to condition (1), both these edges must be colored, while the edge joining \( (0,1) \) and \( (1,0) \) must be left uncolored.

3. **Applying Conditions to Small Triangles:**
   - For the triangle with vertices \( (0,1) \), \( (1,0) \), and \( (1,1) \), the other two sides must be colored.
   - Applying condition (2) to vertices \( (0,1) \) and \( (1,0) \), the edges joining these points to \( (0,2) \) and \( (2,0) \), respectively, must be left uncolored.
   - Consequently, edges joining \( (1,1) \) to both \( (0,2) \) and \( (2,0) \) must be colored.

4. **Continuing the Pattern:**
   - Considering condition (2) applied to vertex \( (1,1) \), either both edges joining this vertex to \( (1,2) \) and \( (2,1) \) are colored, or both are uncolored. Due to condition (1), both are colored, while the edge joining \( (2,1) \) and \( (1,2) \) must be uncolored.
   - Hence, edges joining \( (2,2) \) to both \( (1,2) \) and \( (2,1) \) are colored.

5. **Special Case for \( n = 2 \):**
   - If \( n = 2 \), the task is accomplished, and the scenario is possible.

6. **General Case for \( n > 2 \):**
   - Assume the scenario is possible for some \( n > 2 \).
   - The edge joining \( (2,0) \) and \( (2,1) \) must be left uncolored. Consequently, edges joining \( (3,0) \) to both \( (2,0) \) and \( (2,1) \) must be colored.
   - Due to condition (2), the edge joining \( (2,1) \) and \( (3,1) \) must be colored, or the edge joining \( (3,0) \) and \( (3,1) \) is uncolored.
   - This makes the scenario impossible for \( n = 3 \), as there would be an even number of colored edges meeting at \( A \).

7. **Impossibility for \( n > 3 \):**
   - If \( n > 3 \), the edge joining \( (3,0) \) and \( (4,0) \) must be left uncolored. This makes the triangle formed by these two vertices and \( (3,1) \) violate condition (1).
   - Therefore, the scenario is not possible for \( n > 3 \).

Conclusion:
The scenario is only possible for \( n = 2 \). A possible path is:
\[ A \equiv (2,0) \rightarrow (1,1) \rightarrow (0,1) \rightarrow (0,0) \rightarrow (1,0) \rightarrow (1,1) \rightarrow (2,1) \rightarrow (2,2) \rightarrow (1,2) \rightarrow (1,1) \rightarrow (0,2) \equiv B \]

The final answer is \( \boxed{ n = 2 } \).