truck was dead for about 2 minutes then started the charging system is all good not sure what is happing it sits for a while and dead again

Sounds as though you have corroded or loose/dirty battery cable connections.

Remove/clean and attach wrench tight, including the stater end of the positive cable. Check the engine ground to chassis too.