The International Committee of Medical Journal Editors (ICMJE) recommends four criteria for authorship:
Many journals will ask for a written declaration of each author's contributions to the research.
This Contributor Roles Summary from the Contributor Role Taxonomy (CRediT) can be a helpful guide.
Those who do not meet all four criteria may still be acknowledged as contributors to the work. This is especially useful for funders, technical editors, librarians, and advisors.
Can Artificial Intelligence (AI), such as ChatGPT, be an author?
The Committee on Publication Ethics (COPE) position statement on Authorship and AI tools states that AI
Responsibilities of authorship
Author Order
Discuss authorship issues, such as who will be listed as an author, author order, and contributors to be acknowledged before beginning the project or when situations change, such when someone joins or leaves the project.
See this guidance from COPE - How to handle authorship disputes: a guide for new researchers