Can a football player retire if he is not getting a transfer away from his current club and then come back from retirement to join a new club?
Can such methods will earn him a move or will he has to play for the same club again?
If the contract is still active there are two ways:
If the contract in ending the player is free to sign to another team just at the end of the contract to another team (see free player Antonio Cassano moving to Sampdoria in summer '15). Normally the old team take no money from the new team, but if the player is very young the new team has to pay a contribution for the growth of the young player (see young Paul Pogba moving from Manchester UTD to Juventus in summer '12)
You obviously cannot unilaterally announce to terminate the contract. Imagine telling your boss one day that you're "retiring" from the business only to emerge one week later at a competitor. Does it make any sense? The common usage of "retirement" in football usually comes after the player's contract has ended.