I expect the doctors make their best guess on cause of death. The hospitals are required to report covid positive patients even if it isn't the primary cause of death. Then they become part of the covid fatality numbers.
Not true. Doctors are not permitted to pick and choose from countless causes of death to suit some obscure goal. If the cause of death cannot be definitively defined, then the cause must be listed as "undetermined".
For example, if a Covid patient was sent home after testing positive and then perished at home without further medical intervention, the cause of death would not be listed as covid death until a definitive autopsy was performed. Something not likely to happen for some extended time considering how badly the medical infrastructure is overtaxed.