The captain of a ship flying the Italian flag must be an EU/EEA national.
"Art. 292-bis. (((Requirements for the exercise of the functions of commander and first deck officer). )) 
((On board the ships flying the Italian flag, the commander and the chief mate, if he performs the duties of the master, they must be citizens of a member state of the European Union or of another State party to the Agreement on the Economic Area European Union, made enforceable by law no. 300. Access these functions are subject to the possession of a qualification professional and a knowledge of the language and legislation Italian that allows the keeping of on-board documents and operation of the public functions of which the commander is invested.
By decree of the Minister of Infrastructure and Transport are determined the professional qualification programs, as well as the body competent to carry out the verification procedures of the requirements referred to in the first paragraph.))
[...]
Art. 318 (Nationality of crew members). 
1. The crew of armed national ships in the ports of the Repubblica must be entirely composed of Italian citizens or of other countries belonging to the European Union. (63) [...] 
3. For vessels engaged in sea fishing, the authority peripheral maritime, delegated by the Minister of Infrastructure e of transport, authorizes, upon request by the shipowner, that the on-board personnel is also composed of non-EU citizens, except for the rank of commander.)) [...]" (Navigation Code (ROYAL DECREE 30 March 1942, n. 327), last amended by DECREE-LAW 14 August 2020, n. 104, Articles 292-bis and 318 [google translation])
Navigation Code (ROYAL DECREE 30 March 1942, n. 327), last amended by DECREE-LAW 14 August 2020, n. 104, Articles 292-bis and 318
[<a href="http://www.normattiva.it/uri-res/N2Ls?urn:nir:stato:regio.decreto:1942-03-30;327!vig=2014-09-12">Code</a>]