How to get pyranese inside at night

Mine just runs away. And he barks all night. When he’s inside he chills out. Any ideas?