I should have found a proof of the statement.

First I state the following claims that are well known results about co-h-spaces (for a reference see the literature cited in the comments).

Claim 1: if X is a co-h-space then $\pi_1(X)$ is free.

Claim 2: if X is a co-h-space then taken $\alpha \in H^{p_1}(X; G_1)$, $\beta \in H^{p_2}(X; g_2)$ the cup product $\alpha \cup \beta=0$ in $H^{p_1+p_2}(X; G_1 \otimes G_2)$.

By 1) we have $\pi_1(M) \cong F_r$ and $H_1(M)\cong \mathbb{Z}^r$. Now we know that avery compact manifold is always $\mathbb{Z}/_{2 \mathbb{Z}}$ orientable so we can use the Poincarè duality with coefficients mod 2. It can be proved that if the PD holds then for M without boundary connected compact $R$-orientable manifold then the pairing $H^{k}(M;R)\otimes H^{n-k}(M;R)\rightarrow R$ given by $\alpha \otimes \beta \mapsto\langle \alpha \cup \beta, [M]\rangle$ is perfect.

Therefore we have using 2) for $n>2$ that $H^k(M; \mathbb{Z}/_2)=0$ if $0<k<n$. Now consider the s.e.s. $0 \rightarrow \mathbb{Z} \xrightarrow{2}\mathbb{Z}\rightarrow \mathbb{Z}/_{2 \mathbb{Z}}\rightarrow 0$ and by the associated Bockstein sequence we have $0=H_2(M;\mathbb{Z}/_{2 \mathbb{Z}})\rightarrow H_1(M)\xrightarrow{2}H_1(M)\rightarrow H_{1}(M; \mathbb{Z}/_{2 \mathbb{Z}})=0$ (we need the assumption $n>2$ to get $H_2=H_1=0$ by the PD).

We have proved therefore $\mathbb{Z}^r \xrightarrow{2} \mathbb{Z}^r$ is an iso implying $r=0$ and the fundamental group of $M$ is trivial. This implies that $M$ is $\mathbb{Z}$-orientable (i.e. the classical orientation) and now we can use PD with integer coefficients. Reasoning just as before (use the pairing and claim 2)) we get $H_k(M)=0$ for $0 <k<n$ and trivially $H_0(M)=H_n(M)=\mathbb{Z}$ proving finally the statement of the exercise.

For the case $n=1,2$ we can easily use the classification theorems of $1,2$-dimensional manifolds to get the claim.

If $n=1$ being $M$ compact $M$ must be homeomorphic to the circle $S^1$ which, being the reduced suspension of $S^0$ is a co-h-space.

If $n=2$ recall we proved $H_1(M)=\mathbb{Z}^r$ thus $M$ cannot be a not-orietable surface (since their $H_1$ has torsion): we have $M \cong \Sigma_g$ for some $g \in \mathbb{N}$. We have therefore that $M$ is orientable and as above we argue $H_1(M)\cong H^{1}(M)=0$ leaving the sphere $S^2$ as only possible candidate but $S^2= \Sigma S^1$ a reduced suspension then it is actually a co-h-space.